@media only screen and (min-width: 0rem) {
  :root {
    --dark: #112931;
    --medium: #282828;
    --accent: #404040;
  }
  body {
    transition: background-color 0.3s ease, color 0.3s ease;
  }
body.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #305C6B;
    --bg-button: #1A414E;
    --highlight: #50829B;
    --text-color: #ECECEC;
    --opacity-img: 0.7;
    --transition: background-color 0.3s ease, color 0.3s ease;

    background-color: var(--dark);
    color: #112931;
  }

  body.dark-mode p,
  body.dark-mode li,
  body.dark-mode h1,
  body.dark-mode h2,
  body.dark-mode h3,
  body.dark-mode h4,
  body.dark-mode h5,
  body.dark-mode h6,
  body.dark-mode .cs-title,
  body.dark-mode .cs-text,
  body.dark-mode .cs-li,
  body.dark-mode .smallTxt,
  body.dark-mode .smallTxt a {
    color: var(--text-color);
    transition: var(--transition);
  }
  body.dark-mode ::selection,
  body.dark-mode .page_container,
  body.dark-mode .sidebar-header {
    background-color: var(--dark);
    color: var(--text-color);
}

body.dark-mode select#category,
body.dark-mode select#urgency,
body.dark-mode body.dark-mode .entries {
   background-color: var(--bg-button);
  color: var(--text-color);
  border: 1px solid var(--text-color);
  border-radius: 5px;
  padding: 10px;
  width: 100%;
  transition: var(--transition);
}

body.dark-mode select#category option,
body.dark-mode .category_text,
body.dark-mode select#urgency option {
  background-color: var(--bg-button);
  color: var(--text-color);
}


 body.dark-mode .links > a,
 body.dark-mode .grid > .signatures_container > .objectif,
 body.dark-mode .grid > .petition_information > .entries_modify,
 body.dark-mode .navcontent.dropdown-toggle{
    background-color: transparent;
    color: var(--text-color);
  }

  body.dark-mode .dark {
    display: block !important;
  }
  body.dark-mode .entries_modify textarea {
    background-color: var(--bg-button);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    border-radius: 5px;
    transition: var(--transition);
}

  body.dark-mode #help-button,
  body.dark-mode #don-button,
  body.dark-mode #qr-container,
  body.dark-mode .step,
  body.dark-mode .support,
body.dark-mode .entries button{
    background-color: var(--bg-secondary)
  }


  body.dark-mode #updates,
  body.dark-mode .targetElement,
  body.dark-mode .stat_value_container,
  body.dark-mode .no-discussion-message,
  body.dark-mode .donation,
  body.dark-mode .report.report_second.txt_rep,
  body.dark-mode .report,
  body.dark-mode .admin_tag,
  body.dark-mode .quick_status_action,
  body.dark-mode .warning{
    background: var(--bg-secondary);
    transition: var(--transition);
  }

  body.dark-mode .highlighted-text::before,
  body.dark-mode .self_msg,
  body.dark-mode .other_msg,
  body.dark-mode .category,
  body.dark-mode a.mypet.desktop,
  body.dark-mode .action_btn {
    background-color: var(--highlight);
    transition: var(--transition);
  }
  

  body.dark-mode .login_form,
  body.dark-mode label,
  body.dark-mode .sample_pet,
  body.dark-mode #chat-messages,
  body.dark-mode .comment,
  body.dark-mode .comment_text,
  body.dark-mode .custom-button,
  body.dark-mode textarea#comment,
  body.dark-mode .positioned{
    background-color: var(--bg-button);
    transition: var(--transition);
    color: var(--text-color);
  }
  body.dark-mode .container,
  body.dark-mode .chat_access,
  body.dark-mode .sidebar,
  body.dark-mode .comment_section {
    background-color: var(--dark);
    transition: var(--transition);
}

  body.dark-mode nav,
  body.dark-mode .custom-button.loginbtn,
  body.dark-mode .info-section,
  body.dark-mode .info-section li,
  body.dark-mode .view_signature_btn{
    background-color: var(--bg-secondary);
    transition: var(--transition);
    color: var(--text-color);
  }

  body.dark-mode .pfp {
    filter: invert(92%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
  }

  body.dark-mode .right_img,
  body.dark-mode .left_img {
    opacity: var(--opacity-img);
  }

  .dark {
    display: none;
  }
  body.dark-mode input.form-input {
    background-color: var(--bg-button);
    color: var(--text-color);
    transition: var(--transition);
    border: 1px solid var(--text-color);
  }

  body.dark-mode .creator form:last-child {
    background-color: var(--bg-secondary)
}


body.dark-mode .column.black-squares button {
    background-color: var(--bg-secondary);
    border-radius: 5px;
}

  body.dark-mode .editable,
  body.dark-mode   .sign_petition_btn,
  body.dark-mode  .quick,

  body.dark-mode .popup_content{
    background-color: var(--bg-secondary);
    color: var(--text-color);
    transition: var(--transition);
  }
  body.dark-mode .container_.popup.show h1,
  body.dark-mode .container_.popup.show h2 {
  color: var(--bg-button);
  }
  body.dark-mode .search-container input,
    body.dark-mode .friend {
    border: 1px solid var(--bg-secondary);
    background-color: var(--bg-secondary);
    outline: none;
    flex: 1;
    color: var(--text-color);
    font-size: 20px;
    transition: all 0.3s ease;
  }
  
  body.dark-mode .search-container label {
    position: absolute;
    width: fit-content;
    text-align: left;
    background-color: var(--bg-secondary);
    padding: 0 5px;
    font-size: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
    color: var(--text-color);
  }
  
  body.dark-mode .search-container input:focus + label,
  body.dark-mode .search-container input:not(:placeholder-shown) + label {
    top: -15px;
    left: 25px;
    font-size: 14px;
    color: var(--text-color);
    border: 1px solid var(--dark);
    border-radius: 100px;
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
  }
  
  body.dark-mode .search-container{
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    position: relative;
    transition: var(--transition);
  }
  
  body.dark-mode .search-container button{
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    transition: var(--transition);
  }
  
  body.dark-mode .search-container button img {
    width: 24px;
    height: 24px;
    filter: invert(92%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
  }
  body.dark-mode .profil_gauche {
    background-color: rgba(48, 92, 107, 0.3);
  }
  body.dark-mode.profile-page {
    position: relative;
    background-image: url('../../Resources/img/bg/bglogin.jpeg'); 
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed; 
    color: var(--text-color);
}

body.dark-mode.profile-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-button); 
    opacity: 0.3; 
    z-index: -1; 
    pointer-events: none; 
}
body.dark-mode.chat-page {
  position: relative;
  background-image: url('../../Resources/img/bg/bglogin.jpeg'); 
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed; 
  color: var(--text-color);
}

body.dark-mode.chat-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-button); 
  opacity: 0.3; 
  z-index: -1; 
  pointer-events: none; 
}
body.dark-mode .entries,
body.dark-mode .main_container,
body.dark-mode .grid > .signatures_container,
body.dark-mode .grid > .petition_information{
  background-color: transparent;
  transition: var(--transition);
}

body.dark-mode .entries input,
body.dark-mode .entries textarea,
body.dark-mode .entries select {
  background-color: var(--bg-button);
  color: var(--text-color);
  border: 1px solid var(--text-color);
  border-radius: 5px;
  transition: var(--transition);
}

body.dark-mode .title,
body.dark-mode .info-section strong{
  color: var(--text-color);
}

body.dark-mode .entries label{
  color: var(--text-color);
  transition: var(--transition);
}
body.dark-mode label[for="mail"],
body.dark-mode label[for="password"],
body.dark-mode label[for="username"],
body.dark-mode label[for="confpassword"] {
    transition: all 0.3s ease;
}
body.dark-mode input:focus + label,
body.dark-mode input:not(:placeholder-shown) + label,
body.dark-mode label[for="description"],
body.dark-mode label[for="gender"]{
    background-color: var(--bg-button);
    color: var(--text-color);
    transition: all 0.3s ease;
}
body.dark-mode .action_btn_viewpetition > .action_btn {
    background-color: transparent;
    transition: var(--transition);
}
body.dark-mode .entries:has(#message) {
    background-color: transparent;
}


body.dark-mode .my_profile {
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary), var(--bg-primary));
  background-size: 300% 300%;
  animation: shine-dark 2s ease-in-out infinite;
}

body.dark-mode .user_item {
  box-shadow: 0px 10px 14px rgba(19, 12, 12, 0.4);
  border-left: solid 4px var(--highlight);
  transition: var(--transition), box-shadow 0.3s ease, translate 0.3s ease;
}

body.dark-mode .action button{
    background-color: var(--bg-button) !important;
    color: var(--text-color) !important;
}
@keyframes shine-dark {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

body.dark-mode .category_text {
    background: var(--bg-button);
    color: var(--text-color);
    font-weight: 500;
}
body.dark-mode input[name="name"],
body.dark-mode input[name="objectif"] {
    background: var(--bg-button);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    box-shadow: none;
}
body.dark-mode .limit.positioned,
  body.dark-mode .popup-body,
  body.dark-mode .close {
    background: var(--bg-button);
    color: var(--text-color);
}
body.dark-mode input[name="name"]::placeholder,
body.dark-mode input[name="objectif"]::placeholder {
    color: var(--text-color);
    opacity: 1;
}

body.dark-mode #category,
body.dark-mode #urgency {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--text-color);
}

@media only screen and (min-width: 0rem) {
  body.dark-mode #dark-mode-toggle .cs-sun {
    transform: translate(-50%, -50%);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  body.dark-mode #dark-mode-toggle .cs-moon {
    transform: translate(-50%, -150%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  #dark-mode-toggle {
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 3.75rem;
    width: 3rem;
    height: 3rem;
    background: transparent;
    border: none;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
  }
  #dark-mode-toggle img, #dark-mode-toggle svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5625rem;
    height: 1.5625rem;
    pointer-events: none;
  }
  #dark-mode-toggle .cs-moon {
    z-index: 2;
    transition: transform 0.3s ease, opacity 0.3s ease, fill 0.3s ease;
    fill: #1A414E;
  }
  #dark-mode-toggle .cs-sun {
    z-index: 1;
    transform: translate(-50%, 100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
}
@media only screen and (min-width: 64rem) {
  #dark-mode-toggle {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    margin-bottom: 0rem;
  }
}
}