/* ================= RESET & BASE ================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; overflow-x: hidden; font-family: Arial, sans-serif; }
a { text-decoration: none; color: inherit; }

/* ================= NAVBAR ================= */
.custom-navbar {
  position: fixed;
  width: 100%;
  top: 0;
  height: 80px;
  background-color: white;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

#flash-messages {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  z-index: 2000;
}

/* Menu desktop */
.custom-navbar .menu {
  display: flex;
  gap: 40px;
}

.custom-navbar .navbar-menu {
  text-decoration: none;
  color: rgba(0, 0, 0, 0.877);
  padding: 10px;
}

.custom-navbar .navbar-menu:hover {
  color: blueviolet;
  background-color: aqua;
  border-radius: 40px;
}

/* Hamburger icon (mobile) */
.custom-navbar .hamburger {
  display: none;
  cursor: pointer;
  font-size: 22px;
}

/* ================= MENU HAMBURGER MOBILE ================= */
.custom-navbar .menu-hamburger {
  position: fixed;
  right: -250px;
  top: 0;
  height: 100%;
  width: 200px;
  background-color: white;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: right 0.4s ease;
  overflow-y: auto;
}

/* Quand le menu est ouvert */
.custom-navbar .menu-hamburger.open {
  right: 0;
}

/* ================= BOUTONS AUTH ================= */
.btn-signup {
  background-color: blue;
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
}

/* ================= NEON / GLOW UTILITIES ================= */
:root {
  --neon-color: #7c4dff; /* purple by default */
  --neon-glow: 0 0 2px rgba(124,77,255,0.2), 0 0 4px rgba(124,77,255,0.1);
}

/* utility class to apply neon glow */
.neon {
  position: relative;
  transition: box-shadow .2s ease, transform .15s ease, background-color .2s ease, color .2s ease;
  box-shadow: var(--neon-glow);
}
.neon:focus,
.neon:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 5px rgba(124,77,255,0.2), 0 0 9px rgba(124,77,255,0.1);
}

/* Variantes de neon plus intenses */
.neon--purple {
  --neon-color: #7c4dff;
  box-shadow: 0 2px 8px rgba(124,77,255,0.1), 0 0 10px rgba(124,77,255,0.08);
}
.neon--purple:hover,
.neon--purple:focus {
  box-shadow: 0 3px 10px rgba(124,77,255,0.15), 0 0 15px rgba(124,77,255,0.1);
}

.neon--red {
  --neon-color: #ff3b3b;
  box-shadow: 0 2px 8px rgba(255,59,59,0.1), 0 0 10px rgba(255,59,59,0.1);
}
.neon--red:hover,
.neon--red:focus {
  box-shadow: 0 3px 10px rgba(255,59,59,0.15), 0 0 15px rgba(255,59,59,0.12);
}

/* Apply neon to common interactive elements by default */
button[class^="btn"],
button[class*=" btn-"],
.btn-signup,
.btn-connexion,
.add-btn,
.btn-primary,
.btn-danger,
.btn-success,
.btn-warning,
.btn-info,
.btn-secondary,
.logout-btn-visible {
  --neon-color: #7c4dff;
  box-shadow: 0 1px 4px rgba(124,77,255,0.08);
  transition: box-shadow .2s ease, transform .15s ease, background-color .2s ease, color .2s ease;
}

/* Cards glow */
.quiz-card, .flashcard-card, .card, .feature-card, .developer-card {
  transition: box-shadow .25s ease, transform .18s ease;
}
.quiz-card:hover, .flashcard-card:hover, .card:hover, .feature-card:hover, .developer-card:hover {
  box-shadow: 0 10px 30px rgba(124,77,255,0.12), 0 0 18px rgba(124,77,255,0.08);
  transform: translateY(-6px);
}


.btn-connexion {
  color: blue;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
}

.auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ================= USER MENU ================= */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 15px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.user-avatar:hover {
  border-color: blueviolet;
  transform: scale(1.05);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  display: none;
  z-index: 1000;
  margin-top: 10px;
  padding: 8px 0;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9em;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.user-dropdown a:hover {
  background: #f8f9fa;
  color: blueviolet;
}

.user-dropdown a i {
  width: 16px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: #eee;
  margin: 8px 0;
}

.logout-btn {
  color: #e74c3c !important;
  font-weight: 500;
}

.logout-btn:hover {
  background: #ffeaea !important;
}

/* ================= MOBILE SPECIFIC STYLES ================= */

/* Info utilisateur mobile */
.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: #f8f9fa;
  margin-bottom: 10px;
}

.mobile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid blueviolet;
}

.mobile-user-details {
  display: flex;
  flex-direction: column;
}

.mobile-user-details strong {
  color: #333;
  font-size: 1em;
}

.mobile-user-details span {
  color: #666;
  font-size: 0.8em;
}

/* Liens menu mobile */
.menu-hamburger .navbar-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: black;
  text-decoration: none;
  transition: background 0.3s;
  border-bottom: 1px solid #f0f0f0;
}

.menu-hamburger .navbar-menu:hover {
  background: rgba(0, 0, 0, 0.05);
}

.menu-hamburger .logout-mobile {
  color: #e74c3c;
  font-weight: 500;
}

.menu-hamburger .dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 0;
}

/* Boutons auth mobile */
.mobile-auth-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 5px 0;
  border-radius: 0;
  text-align: left;
  border: none;
  background: none;
  color: black;
  text-decoration: none;
  transition: background 0.3s;
  width: 100%;
  border-bottom: 1px solid #f0f0f0;
}

.mobile-auth-btn.btn-connexion:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mobile-auth-btn.btn-signup {
  background: blue;
  color: white;
}

.mobile-auth-btn.btn-signup:hover {
  background: #0000cc;
}

/* ================= NOTIFICATIONS ================= */
.notification-bell {
  position: relative;
  cursor: pointer;
}

.notification-bell i {
  font-size: 1.3em;
  color: rgba(0, 0, 0, 0.877);
  transition: color 0.3s ease;
}

.notification-bell:hover i {
  color: blueviolet;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7em;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid white;
}

.mobile-notification-count {
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7em;
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  font-weight: bold;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 350px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  display: none;
  z-index: 1000;
  margin-top: 10px;
}

.notification-dropdown.show {
  display: block;
}

.notification-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h4 {
  margin: 0;
  color: #333;
  flex: 1;
}

.notification-header button {
  background: none;
  border: none;
  color: blueviolet;
  cursor: pointer;
  font-size: 0.8em;
  text-decoration: underline;
}

.notification-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Responsive dropdown adjustments */
@media (max-width: 900px) {
  .notification-dropdown {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: calc(100% - 16px);
  }
  /* On mobile make the dropdown compact, fixed below navbar and scrollable */
  .notification-dropdown {
    position: fixed;
    top: 72px; /* just below navbar (80px) */
    left: 8px;
    right: 8px;
    width: auto;
    max-width: calc(100% - 16px);
    z-index: 1500;
    margin-top: 0;
    border-radius: 10px;
  }
  .notification-list { max-height: 45vh; overflow-y: auto; }
}

/* Loader inside notification dropdown */
.notification-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  gap: 6px;
}
.notification-loader .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-color, #7c4dff);
  opacity: 0.7;
  animation: jump 1s infinite ease-in-out;
}
.notification-loader .dot:nth-child(2) { animation-delay: 0.12s; }
.notification-loader .dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes jump {
  0% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-6px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.6; }
}

.notification-item {
  padding: 12px 15px;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: #f8f9fa;
}

.notification-item.unread {
  background: #f0f7ff;
  border-left: 3px solid blueviolet;
}

.notification-message {
  color: #333;
  font-size: 0.9em;
  margin-bottom: 5px;
}

.notification-time {
  color: #666;
  font-size: 0.8em;
}

.notification-footer {
  padding: 12px 15px;
  text-align: center;
  border-top: 1px solid #eee;
}

.notification-footer a {
  color: blueviolet;
  text-decoration: none;
  font-size: 0.9em;
}

/* Menu mobile notifications */
.mobile-notification .navbar-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= NAV-RIGHT ================= */
.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 861px) {
  .custom-navbar .menu, 
  .custom-navbar .auth-buttons,
  .user-menu {
    display: none;
  }

  /* Keep notification bell visible on mobile */
  .custom-navbar .notification-bell {
    display: flex !important;
    align-items: center;
    margin-right: 8px;
  }

  .custom-navbar h3 {
    position: absolute;
    left: 10%;
  }

  .custom-navbar .hamburger {
    position: absolute;
    right: 10%;
    display: block;
  }
}

@media (min-width: 862px) {
  .menu-hamburger {
    display: none !important;
  }
}

/* ================= FOOTER ================= */
footer {
  background-color: rgba(0, 0, 0, 0.966);
  color: gray;
  padding: 40px 20px 20px;
  font-size: 14px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: auto;
}

.footer-col h3 {
  color: white;
  margin-bottom: 15px;
  font-size: 18px;
}

.footer-col p {
  margin: 6px 0;
  cursor: pointer;
  transition: color 0.3s;
}

.footer-col p:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  border-top: 1px solid gray;
  padding-top: 15px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    text-align: center;
  }
}

@media (max-width: 600px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* ================= BOUTON DECONNEXION VISIBLE ================= */
.logout-btn-visible {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: #e74c3c;
  color: white !important;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-left: 10px;
  border: none;
}

.logout-btn-visible:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
  color: white !important;
}

.logout-btn-visible i {
  font-size: 0.9em;
}

/* Ajustement du user-menu pour inclure le bouton déconnexion */
.user-menu {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Sur mobile, cacher le bouton déconnexion visible */
@media (max-width: 861px) {
  .logout-btn-visible {
    display: none;
  }
}
@media (max-width: 861px) {
  .custom-navbar .menu,
  .custom-navbar .auth-buttons,
  .custom-navbar .user-menu {
    display: none !important;
  }

  /* Keep notification bell visible on mobile (do not hide it) */
  .custom-navbar .hamburger {
    display: block !important;
  }
}

/* ================= DARK MODE TOGGLE BUTTON ================= */
.dark-mode-toggle {
  cursor: pointer;
  font-size: 1.3em;
  color: rgba(0, 0, 0, 0.877);
  transition: all 0.3s ease;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
}

.dark-mode-toggle:hover {
  color: blueviolet;
  background: rgba(138, 43, 226, 0.1);
}

.dark-mode .dark-mode-toggle {
  color: #0ff;
}

.dark-mode .dark-mode-toggle:hover {
  background: rgba(0, 255, 255, 0.1);
}

/* ================= DARK MODE STYLES ================= */
.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

/* Body and main containers */
.dark-mode body {
  background-color: #121212;
  color: #e0e0e0;
}

/* Navbar Dark */
.dark-mode .custom-navbar {
  background-color: #1e1e1e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid #333;
}

.dark-mode .custom-navbar h3 {
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
}

.dark-mode .custom-navbar .navbar-menu {
  color: #e0e0e0;
}

.dark-mode .custom-navbar .navbar-menu:hover {
  color: #0ff;
  background-color: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Buttons with neon glow */
.dark-mode button,
.dark-mode .btn-signup,
.dark-mode .btn-connexion,
.dark-mode .btn-submit,
.dark-mode .add-btn,
.dark-mode .btn-primary,
.dark-mode .btn-danger,
.dark-mode .btn-success,
.dark-mode .btn-warning,
.dark-mode .btn-info,
.dark-mode .btn-secondary,
.dark-mode .logout-btn-visible {
  background-color: #1e1e1e;
  color: #7cf8ff; /* Lighter cyan for better contrast */
  border: 1px solid #0ff;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.3), 0 0 15px rgba(0, 255, 255, 0.1);
  transition: all 0.2s ease;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.dark-mode button:hover,
.dark-mode .btn-signup:hover,
.dark-mode .btn-connexion:hover,
.dark-mode .btn-submit:hover,
.dark-mode .logout-btn-visible:hover {
  background-color: #0ff;
  color: #0a0a0a;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 0 30px rgba(0, 255, 255, 0.2);
  transform: translateY(-1px);
  text-shadow: none;
}

/* Logout button specific */
.dark-mode .logout-btn-visible {
  background: #1e1e1e;
  color: #ff3b3b;
  border: 1px solid #ff3b3b;
  box-shadow: 0 0 15px rgba(255, 59, 59, 0.5);
}

.dark-mode .logout-btn-visible:hover {
  background: #ff3b3b;
  color: #fff;
  box-shadow: 0 0 20px #ff3b3b, 0 0 40px rgba(255, 59, 59, 0.5);
}

/* Cards with neon glow */
.dark-mode .card,
.dark-mode .quiz-card,
.dark-mode .flashcard-card,
.dark-mode .feature-card,
.dark-mode .developer-card,
.dark-mode .notification-item,
.dark-mode .modal-content {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #333;
  color: #e0e0e0;
  border: 1px solid #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.dark-mode .card:hover,
.dark-mode .quiz-card:hover,
.dark-mode .flashcard-card:hover,
.dark-mode .feature-card:hover,
.dark-mode .developer-card:hover {
  box-shadow: 0 0 20px #0ff, 0 0 40px rgba(0, 255, 255, 0.3);
  transform: translateY(-6px);
  border-color: #0ff;
}

/* Forms and Inputs - Style emergent.sh */
.dark-mode input,
.dark-mode textarea,
.dark-mode select,
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode .input-search {
  background-color: #252525;
  color: #f0f0f0;
  border: 1px solid #444;
  transition: all 0.2s ease;
}

.dark-mode input:focus,
.dark-mode textarea:focus,
.dark-mode select:focus,
.dark-mode .form-control:focus,
.dark-mode .form-select:focus,
.dark-mode .input-search:focus {
  border-color: #0ff;
  background-color: #2a2a2a;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
  outline: none;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
  color: #aaa;
  opacity: 1;
}

/* Modal Dark */
.dark-mode .modal {
  background: rgba(0, 0, 0, 0.85);
}

.dark-mode .modal-content {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  border: 1px solid #0ff;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

/* Higher-specificity dark-mode modal override to win against inline/late .modal-content rules
   in templates (inline styles in head), use element+class specificity so it takes precedence. */
body.dark-mode .modal-content {
  background: linear-gradient(135deg, #0e0e0e 0%, #171717 100%);
  color: #dff9ff; /* light cyan-ish for readable headings and text */
  border: 1px solid rgba(0,255,255,0.06);
  box-shadow: 0 8px 40px rgba(0,255,255,0.06), 0 0 30px rgba(0,255,255,0.06) inset;
}

body.dark-mode .modal-content .close,
body.dark-mode .modal-content .close-btn {
  color: #e6f8ff;
}

/* Ensure modal-panel also follows high-specificity rule */
body.dark-mode .modal-panel {
  background: #121212;
  color: #e6f8ff;
  border: 1px solid #222;
}

/* Ensure modal-panel (used by quiz modals) is dark in dark-mode */
.dark-mode .modal-panel {
  background: #121212;
  color: #e6f8ff;
  border: 1px solid #222;
}

.dark-mode .modal-content h2 {
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
}

.dark-mode .close-btn {
  color: #0ff;
}

.dark-mode .toggle-link {
  color: #0ff;
}

.dark-mode .toggle-link:hover {
  text-shadow: 0 0 10px #0ff;
}

/* Footer Dark */
.dark-mode footer {
  background-color: #0a0a0a;
  border-top: 1px solid #333;
}

.dark-mode footer h3 {
  color: #0ff;
}

.dark-mode footer p {
  color: #888;
}

.dark-mode footer p:hover {
  color: #0ff;
}

/* Notifications Dark */
.dark-mode .notification-dropdown {
  background-color: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.dark-mode .notification-header {
  border-bottom: 1px solid #333;
}

.dark-mode .notification-header h4 {
  color: #0ff;
}

.dark-mode .notification-header button {
  color: #0ff;
}

.dark-mode .notification-item {
  border-bottom: 1px solid #2a2a2a;
}

.dark-mode .notification-item:hover {
  background: #252525;
}

.dark-mode .notification-item.unread {
  background: #1e2a3a;
  border-left: 3px solid #0ff;
}

.dark-mode .notification-message {
  color: #e0e0e0;
}

.dark-mode .notification-time {
  color: #888;
}

.dark-mode .notification-footer {
  border-top: 1px solid #333;
}

.dark-mode .notification-footer a {
  color: #0ff;
}

/* User menu Dark */
.dark-mode .user-dropdown {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.dark-mode .user-dropdown a {
  color: #e0e0e0;
}

.dark-mode .user-dropdown a:hover {
  background: #252525;
  color: #0ff;
}

.dark-mode .dropdown-divider {
  background: #333;
}

/* Mobile menu Dark */
.dark-mode .menu-hamburger {
  background-color: #1a1a1a;
  border-left: 1px solid #333;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.dark-mode .mobile-user-info {
  background: #0a0a0a;
  border-bottom: 1px solid #333;
}

.dark-mode .mobile-user-details strong {
  color: #0ff;
}

.dark-mode .mobile-user-details span {
  color: #888;
}

.dark-mode .menu-hamburger .navbar-menu {
  color: #e0e0e0;
  border-bottom: 1px solid #2a2a2a;
}

.dark-mode .menu-hamburger .navbar-menu:hover {
  background: #252525;
  color: #0ff;
}

/* Icons Dark */
.dark-mode .notification-bell i,
.dark-mode .hamburger {
  color: #0ff;
}

.dark-mode .notification-bell:hover i,
.dark-mode .hamburger:hover {
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
}

/* Alert messages Dark */
.dark-mode .alert {
  background: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #333;
}

.dark-mode .alert-success {
  border-color: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.dark-mode .alert-danger {
  border-color: #ff3b3b;
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.2);
}

/* Loader dots Dark */
.dark-mode .notification-loader .dot {
  background: #0ff;
  box-shadow: 0 0 5px #0ff;
}

/* Text colors */
.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
  color: #e0e0e0;
}

.dark-mode p {
  color: #b0b0b0;
}

.dark-mode a {
  color: #0ff;
}

.dark-mode a:hover {
  text-shadow: 0 0 10px #0ff;
}

/* Specific elements */
.dark-mode .card .titre {
  color: #0ff;
}

.dark-mode .card .ressources,
.dark-mode .card .mise-a-jour span,
.dark-mode .card p {
  color: #888;
}

/* ================= DARK MODE - ABOUT & CONTACT PAGES ================= */
.dark-mode .about-container,
.dark-mode .contact-container {
  background-color: #0a0a0a;
}

.dark-mode .about-header h1,
.dark-mode .contact-header h1 {
  color: #0ff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.dark-mode .about-header p,
.dark-mode .contact-header p {
  color: #e0e0e0;
}

.dark-mode .developer-card,
.dark-mode .site-info,
.dark-mode .contact-info,
.dark-mode .contact-form {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.1);
}

.dark-mode .developer-card:hover,
.dark-mode .site-info:hover,
.dark-mode .contact-info:hover,
.dark-mode .contact-form:hover {
  box-shadow: 0 0 20px #0ff, 0 0 40px rgba(0, 255, 255, 0.3);
  border-color: #0ff;
}

.dark-mode .developer-photo {
  border: 5px solid #0ff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.dark-mode .developer-name {
  color: #0ff;
}

.dark-mode .developer-title {
  color: #0ff;
  opacity: 0.8;
}

.dark-mode .developer-card p {
  color: #e0e0e0;
}

.dark-mode .contact-item {
  color: #e0e0e0;
  background: #0a0a0a;
  border: 1px solid #333;
}

.dark-mode .contact-item:hover {
  background: #252525;
  border-color: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode .contact-item i {
  color: #0ff;
}

.dark-mode .info-content h3 {
  color: #0ff;
}

.dark-mode .info-content p {
  color: #888;
}

.dark-mode .section-title {
  color: #0ff;
  border-bottom: 3px solid #0ff;
}

.dark-mode .site-info p,
.dark-mode .site-info h3 {
  color: #e0e0e0;
}

.dark-mode .feature-card {
  background: #0a0a0a;
  border-left: 4px solid #0ff;
  border: 1px solid #333;
}

.dark-mode .feature-card:hover {
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
  border-left-color: #0ff;
}

.dark-mode .feature-card h4 {
  color: #0ff;
}

.dark-mode .feature-card h4 i {
  color: #0ff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.dark-mode .feature-card p {
  color: #888;
}

.dark-mode .tech-badge {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode .stats-section {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  border: 1px solid #0ff;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.dark-mode .stats-section h2 {
  color: #0ff;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.dark-mode .stat-number {
  color: #0ff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.dark-mode .stat-label {
  color: #e0e0e0;
}

.dark-mode .btn-primary {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #0ff;
  box-shadow: 0 0 15px #0ff, 0 0 30px rgba(0, 255, 255, 0.3);
}

/* Additional dark-mode fixes for pages that still had white blocks */
/* Resource / note cards and generic page blocks */
.dark-mode .ressources-list,
.dark-mode .start-discussion,
.dark-mode .discussion-list,
.dark-mode .action-rapide,
.dark-mode .sujet-populaire,
.dark-mode .statistique,
.dark-mode .form-partage,
.dark-mode .page,
.dark-mode main,
.dark-mode .block-2,
.dark-mode .discussion-list-info,
.dark-mode .discussion-list-info p,
.dark-mode .discussion-list-info .p1,
.dark-mode .discussion-list-info .p2 {
  background-color: #141414;
  color: #dcdcdc;
  border: 1px solid #222;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

/* Header sections that use background images or explicit white backgrounds */
.dark-mode .header,
.dark-mode .header-content,
.dark-mode .about-header,
.dark-mode .contact-header {
  background-color: rgba(10,10,10,0.6) !important;
  color: #e6faff;
}

/* Resource media area (images/videos placeholders) */
.dark-mode .ressource-media,
.dark-mode .ressource-media .icon-placeholder {
  background: linear-gradient(180deg, #111111, #1a1a1a);
  color: #bfefff;
}
.dark-mode .ressource-media img,
.dark-mode .ressource-media video { background: #0a0a0a !important; }

/* Buttons in footers / page sections: ensure hover contrast */
.dark-mode .btn-footer a:first-child:hover {
  background: rgba(124,77,255,0.95);
  color: #fff;
}
.dark-mode .btn-footer a:last-child:hover,
.dark-mode .btn-footer a:nth-child(2):hover {
  background: #0ff;
  color: #0a0a0a;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,255,255,0.12);
}

/* Ensure small action buttons are legible on hover */
.dark-mode .btn-view:hover,
.dark-mode .btn-download:hover,
.dark-mode .btn-primary:hover,
.dark-mode .btn-submit:hover {
  background: #0ff !important;
  color: #070707 !important;
  box-shadow: 0 0 20px #0ff, 0 0 40px rgba(0,255,255,0.18) !important;
}

/* Replace explicit white hover backgrounds used in some local CSS */
.dark-mode .btn-footer a:last-child:hover { border-color: transparent; }

/* Fix modal overlay and form background when inline styles were used */
.dark-mode .modal-content[style],
.dark-mode [style*="background: #fff"],
.dark-mode [style*="background: #ffffff"] {
  background: linear-gradient(135deg,#121212,#1a1a1a) !important;
  color: #e8faff !important;
  border: 1px solid #222 !important;
}

/* Developer / info boxes */
.dark-mode .developer-card,
.dark-mode .site-info,
.dark-mode .contact-info,
.dark-mode .contact-form {
  background: linear-gradient(180deg,#0f0f0f,#151515);
  border: 1px solid #222;
}

/* Make sure link hover in dark mode remains visible */
.dark-mode .btn-footer a:last-child:hover a,
.dark-mode a:hover { text-shadow: 0 0 10px #0ff; }

/* Small accessibility tweak: increase button text contrast on hover in sections like profile/note */
.dark-mode .activity-item:hover,
.dark-mode .note-card:hover,
.dark-mode .ressources-list:hover {
  color: #030303;
}

.dark-mode .btn-primary:hover {
  background: #0ff;
  color: #0a0a0a;
  box-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
}

.dark-mode .social-link {
  color: #0ff;
}

.dark-mode .social-link:hover {
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.dark-mode .cta-section h2 {
  color: #0ff;
}

.dark-mode .cta-section p {
  color: #e0e0e0;
}

/* Contact page specific */
.dark-mode .form-group label {
  color: #0ff;
}

.dark-mode .form-control {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 2px solid #333;
}

.dark-mode .form-control:focus {
  border-color: #0ff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.dark-mode .form-control::placeholder {
  color: #888;
}

.dark-mode .btn-whatsapp {
  background: #1e1e1e;
  color: #25D366;
  border: 1px solid #25D366;
  box-shadow: 0 0 15px rgba(37, 211, 102, 0.3);
}

.dark-mode .btn-whatsapp:hover {
  background: #25D366;
  color: #0a0a0a;
  box-shadow: 0 0 20px #25D366, 0 0 40px rgba(37, 211, 102, 0.3);
}

.dark-mode .btn-whatsapp:disabled {
  background: #333;
  border-color: #666;
  box-shadow: none;
}

.dark-mode .social-link-contact {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode .social-link-contact:hover {
  background: #0ff;
  color: #0a0a0a;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.dark-mode .quick-actions {
  background: #0a0a0a;
  border-left: 4px solid #0ff;
  border: 1px solid #333;
}

.dark-mode .quick-actions h3 {
  color: #0ff;
}

.dark-mode .quick-action-btn {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode .quick-action-btn:hover {
  background: #0ff;
  color: #0a0a0a;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.dark-mode .alert {
  background: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #333;
}

.dark-mode .alert-info {
  background: #1e2a3a;
  border-left: 4px solid #0ff;
  color: #0ff;
}

.dark-mode .alert-warning {
  background: #2a2a1a;
  border-left: 4px solid #ff9800;
  color: #ff9800;
}

.dark-mode .alert-success {
  background: #1a2a1a;
  border-left: 4px solid #25D366;
  color: #25D366;
}

.dark-mode .alert-danger {
  background: #2a1a1a;
  border-left: 4px solid #ff3b3b;
  color: #ff3b3b;
}

/* ================= DARK MODE - VIDEO PAGE ================= */
.dark-mode .videos-container {
  background-color: #0a0a0a;
}

.dark-mode .filters {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.1);
}

.dark-mode .filter-group label {
  color: #0ff;
}

.dark-mode .filter-group select,
.dark-mode .filter-group input {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #333;
}

.dark-mode .filter-group select:focus,
.dark-mode .filter-group input:focus {
  border-color: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode .video-card {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.dark-mode .video-card:hover {
  box-shadow: 0 0 20px #0ff, 0 0 40px rgba(0, 255, 255, 0.3);
  border-color: #0ff;
  transform: translateY(-5px);
}

.dark-mode .video-thumbnail {
  background: #0a0a0a;
}

.dark-mode .video-info {
  background: #1a1a1a;
}

.dark-mode .video-title {
  color: #0ff;
}

.dark-mode .video-meta {
  color: #888;
}

.dark-mode .video-actions button {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode .video-actions button:hover {
  background: #0ff;
  color: #0a0a0a;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* ================= DARK MODE - QUIZ & FLASHCARDS ================= */
.dark-mode .quiz-container,
.dark-mode .flashcard-container {
  background-color: #0a0a0a;
}

.dark-mode .quiz-card,
.dark-mode .flashcard-card {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.dark-mode .quiz-card:hover,
.dark-mode .flashcard-card:hover {
  box-shadow: 0 0 20px #0ff, 0 0 40px rgba(0, 255, 255, 0.3);
  border-color: #0ff;
  transform: translateY(-5px);
}

.dark-mode .quiz-title,
.dark-mode .flashcard-title {
  color: #0ff;
}

.dark-mode .quiz-description,
.dark-mode .flashcard-description {
  color: #888;
}

.dark-mode .quiz-button,
.dark-mode .flashcard-button,
.dark-mode .start-quiz-btn,
.dark-mode .flip-card-btn {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #0ff;
  box-shadow: 0 0 15px #0ff, 0 0 30px rgba(0, 255, 255, 0.3);
}

.dark-mode .quiz-button:hover,
.dark-mode .flashcard-button:hover,
.dark-mode .start-quiz-btn:hover,
.dark-mode .flip-card-btn:hover {
  background: #0ff;
  color: #0a0a0a;
  box-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
}

.dark-mode .quiz-stats,
.dark-mode .flashcard-stats {
  background: #0a0a0a;
  color: #888;
  border: 1px solid #333;
}

.dark-mode .question-text {
  color: #e0e0e0;
}

.dark-mode .answer-option {
  background: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #333;
}

.dark-mode .answer-option:hover {
  background: #252525;
  border-color: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode .answer-option.correct {
  background: #1a2a1a;
  border-color: #25D366;
  box-shadow: 0 0 15px rgba(37, 211, 102, 0.3);
}

.dark-mode .answer-option.incorrect {
  background: #2a1a1a;
  border-color: #ff3b3b;
  box-shadow: 0 0 15px rgba(255, 59, 59, 0.3);
}

/* Alias and additional coverage for quiz_flashcards .option/.option-text and expand button
   (the quiz template uses .option/.option-text while older rules targeted .answer-option)
   This ensures hover and three-dots (btn-expand) remain readable in dark mode. */
.dark-mode .option,
.dark-mode .option .option-text {
  background: #1e1e1e;
  color: #e6f8ff; /* slightly icy-cyan for good contrast */
  border-color: #333;
}

.dark-mode .option:hover {
  background: #122029; /* darker cyan-tinged background on hover */
  border-color: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.18);
  color: #e6f8ff;
}

.dark-mode .option.selected {
  border-color: #0ff;
  background: rgba(0,255,255,0.04);
  color: #e6f8ff;
}

/* btn-expand is rendered with an inline color in the template; force a readable color in dark mode */
.dark-mode .btn-expand {
  color: #0ff !important;
  background: transparent !important;
  border: none !important;
}


.dark-mode .flashcard-front,
.dark-mode .flashcard-back {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #e0e0e0;
}

.dark-mode .highlighted {
  background: #1e2a3a !important;
  border-color: #0ff !important;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5) !important;
  animation: pulse-neon 2s ease-in-out;
}

@keyframes pulse-neon {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), 0 0 60px rgba(0, 255, 255, 0.5);
  }
}

/* ================= DARK MODE - SYSTEME PAGE ================= */
.dark-mode .systeme-container {
  background-color: #0a0a0a;
}

.dark-mode .systeme-card {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.dark-mode .systeme-card:hover {
  box-shadow: 0 0 20px #0ff, 0 0 40px rgba(0, 255, 255, 0.3);
  border-color: #0ff;
  transform: translateY(-5px);
}

.dark-mode .systeme-title {
  color: #0ff;
}

.dark-mode .systeme-description {
  color: #888;
}

/* ================= DARK MODE - LEARN HTML/CSS PAGES ================= */
.dark-mode .learn-container {
  background-color: #0a0a0a;
}

.dark-mode .lesson-card {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.dark-mode .lesson-card:hover {
  box-shadow: 0 0 20px #0ff, 0 0 40px rgba(0, 255, 255, 0.3);
  border-color: #0ff;
}

.dark-mode .code-block {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #e0e0e0;
}

.dark-mode code {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #333;
}

.dark-mode pre {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #e0e0e0;
}

/* ================= GENERIC DARK MODE ELEMENTS ================= */
.dark-mode .container {
  background-color: #0a0a0a;
}

.dark-mode .section {
  background-color: #0a0a0a;
}

.dark-mode .box {
  background: #1a1a1a;
  border: 1px solid #333;
}

.dark-mode .panel {
  background: #1a1a1a;
  border: 1px solid #333;
}

.dark-mode .list-item {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #e0e0e0;
}

.dark-mode .list-item:hover {
  background: #252525;
  border-color: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dark-mode hr {
  border-color: #333;
}

.dark-mode .divider {
  background: #333;
}

.dark-mode .badge {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #333;
}

.dark-mode .tag {
  background: #1e1e1e;
  color: #0ff;
  border: 1px solid #333;
}

.dark-mode .label {
  color: #0ff;
}

.dark-mode table {
  background: #1a1a1a;
  border: 1px solid #333;
}

.dark-mode th {
  background: #0a0a0a;
  color: #0ff;
  border: 1px solid #333;
}

.dark-mode td {
  background: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #333;
}

.dark-mode tr:hover {
  background: #252525;
}

/* Scrollbar dark mode */
.dark-mode ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.dark-mode ::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.dark-mode ::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Selection color dark mode */
.dark-mode ::selection {
  background: rgba(0, 255, 255, 0.3);
  color: #0ff;
}

.dark-mode ::-moz-selection {
  background: rgba(0, 255, 255, 0.3);
  color: #0ff;
}

