/* =============================================================================
   MODE NOCTURNE - CORRECTIONS GLOBALES
   Prépa-SSIAP - Toutes les corrections pour le dark mode
   ============================================================================= */

/* ===== BASE ===== */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    min-height: 100vh;
    color: #e8e8e8 !important;
}

/* ===== NAVBAR ===== */
body.dark-mode .navbar {
    background: rgba(26, 26, 46, 0.95) !important;
    border-bottom: 1px solid rgba(74, 144, 217, 0.3);
}

body.dark-mode .navbar-brand span,
body.dark-mode .navbar .nav-link {
    color: #e8e8e8 !important;
}

/* Menu déroulant mobile */
body.dark-mode .navbar-collapse {
    background: rgba(26, 26, 46, 0.98) !important;
}

body.dark-mode .navbar-nav .nav-link {
    color: #e8e8e8 !important;
}

body.dark-mode .navbar-nav .nav-link:hover {
    color: #4a90d9 !important;
}

/* ===== LOGOS ===== */
body.dark-mode img[alt*="Logo"],
body.dark-mode .footer-logo,
body.dark-mode .login-logo,
body.dark-mode .navbar-brand img {
    filter: brightness(1.2) !important;
}

/* ===== HEADINGS ===== */
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6 {
    color: #e8e8e8 !important;
}

body.dark-mode p,
body.dark-mode li,
body.dark-mode span {
    color: #94a3b8 !important;
}

body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

/* ===== CARDS ===== */
body.dark-mode .card {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e8e8e8 !important;
    border-color: rgba(74, 144, 217, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .card-title,
body.dark-mode .card-text {
    color: #e8e8e8 !important;
}

/* ===== TABLES ===== */
body.dark-mode .table {
    color: #e8e8e8 !important;
    background: rgba(30, 41, 59, 0.9) !important;
}

body.dark-mode .table th {
    background: rgba(15, 23, 42, 0.5) !important;
    color: #94a3b8 !important;
    border-color: rgba(74, 144, 217, 0.2) !important;
}

body.dark-mode .table td {
    border-color: rgba(74, 144, 217, 0.15) !important;
}

body.dark-mode .table-hover tbody tr:hover {
    background: rgba(74, 144, 217, 0.1) !important;
}

/* ===== FICHES ===== */
body.dark-mode .fiche-card,
body.dark-mode .fiche-content,
body.dark-mode .fiche-item {
    background: rgba(30, 41, 59, 0.95) !important;
    color: #e8e8e8 !important;
    border-color: rgba(74, 144, 217, 0.3) !important;
}

body.dark-mode .fiche-title {
    color: #4a90d9 !important;
}

body.dark-mode .fiche-category {
    background: rgba(74, 144, 217, 0.2) !important;
    color: #93c5fd !important;
}

/* ===== MENTIONS LÉGALES & CONFIDENTIALITÉ ===== */
body.dark-mode .legal-content,
body.dark-mode .privacy-content,
body.dark-mode .legal-section,
body.dark-mode .privacy-section {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e8e8e8 !important;
}

body.dark-mode .legal-content h1,
body.dark-mode .legal-content h2,
body.dark-mode .legal-content h3,
body.dark-mode .privacy-content h1,
body.dark-mode .privacy-content h2,
body.dark-mode .privacy-content h3 {
    color: #4a90d9 !important;
}

body.dark-mode .legal-content p,
body.dark-mode .legal-content li,
body.dark-mode .privacy-content p,
body.dark-mode .privacy-content li {
    color: #94a3b8 !important;
}

/* ===== CTA SECTION (Prêt à réussir) ===== */
body.dark-mode .cta-section {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.3) 0%, rgba(102, 126, 234, 0.3) 100%) !important;
}

body.dark-mode .cta-section h2,
body.dark-mode .cta-section p {
    color: #e8e8e8 !important;
}

/* ===== FORMS ===== */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: rgba(74, 144, 217, 0.3) !important;
    color: #e8e8e8 !important;
}

body.dark-mode .form-control::placeholder {
    color: #64748b !important;
}

body.dark-mode .form-label {
    color: #94a3b8 !important;
}

/* ===== ALERTS ===== */
body.dark-mode .alert-info {
    background: rgba(74, 144, 217, 0.2) !important;
    border-color: rgba(74, 144, 217, 0.3) !important;
    color: #93c5fd !important;
}

body.dark-mode .alert-warning {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
    color: #fcd34d !important;
}

/* ===== MODALS ===== */
body.dark-mode .modal-content {
    background: #1e293b !important;
    border: 1px solid rgba(74, 144, 217, 0.3);
}

body.dark-mode .modal-header {
    border-bottom-color: rgba(74, 144, 217, 0.2) !important;
}

body.dark-mode .modal-header .modal-title {
    color: #e8e8e8 !important;
}

body.dark-mode .modal-footer {
    border-top-color: rgba(74, 144, 217, 0.2) !important;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ===== PROGRESS BARS ===== */
body.dark-mode .progress {
    background: rgba(15, 23, 42, 0.5) !important;
}

/* ===== BADGES ===== */
body.dark-mode .badge {
    border: 1px solid rgba(74, 144, 217, 0.3);
}

/* ===== DROPDOWNS ===== */
body.dark-mode .dropdown-menu {
    background: rgba(30, 41, 59, 0.98) !important;
    border-color: rgba(74, 144, 217, 0.3) !important;
}

body.dark-mode .dropdown-item {
    color: #e8e8e8 !important;
}

body.dark-mode .dropdown-item:hover {
    background: rgba(74, 144, 217, 0.2) !important;
}

/* ===== ADMIN SPECIFIC ===== */
body.dark-mode .dashboard-card {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(74, 144, 217, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .stat-value {
    color: #4a90d9 !important;
}

body.dark-mode .sidebar {
    background: rgba(26, 26, 46, 0.95) !important;
    border-right: 1px solid rgba(74, 144, 217, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body.dark-mode .navbar-collapse {
        background: rgba(26, 26, 46, 0.98) !important;
        padding: 1rem;
    }
}

/* ===== ANIMATIONS ===== */
body.dark-mode * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


/* === CORRECTION MENU MOBILE MODE NOCTURNE === */
@media (max-width: 991.98px) {
  body.dark-mode .navbar-collapse {
    background-color: #1a1a1a !important;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
  }
  
  body.dark-mode .navbar-nav .nav-link {
    color: #ffffff !important;
  }
  
  body.dark-mode .navbar-nav .nav-link:hover {
    background-color: #2d2d2d !important;
    color: #4a90d9 !important;
  }
  
  body.dark-mode .navbar-nav .nav-link.active {
    background-color: #2d2d2d !important;
    color: #4a90d9 !important;
  }
}


/* === CORRECTION ZONE CTA "PRÊT À RÉUSSIR" === */
body.dark-mode .cta-section,
body.dark-mode .bg-primary,
body.dark-mode .bg-gradient {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
}

body.dark-mode .cta-section h2,
body.dark-mode .cta-section p {
  color: #ffffff !important;
}


/* === CORRECTION FICHES MODE NOCTURNE === */
body.dark-mode .fiche-card,
body.dark-mode .card {
  background-color: #1e1e1e !important;
  border-color: #333333 !important;
  color: #e0e0e0 !important;
}

body.dark-mode .fiche-card .card-header,
body.dark-mode .card-header {
  background-color: #2d2d2d !important;
  border-bottom-color: #444444 !important;
  color: #ffffff !important;
}

body.dark-mode .fiche-card .card-body,
body.dark-mode .card-body {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

body.dark-mode .fiche-content,
body.dark-mode .fiche-content * {
  color: #e0e0e0 !important;
}

body.dark-mode .fiche-card h1,
body.dark-mode .fiche-card h2,
body.dark-mode .fiche-card h3,
body.dark-mode .fiche-card h4,
body.dark-mode .fiche-card h5,
body.dark-mode .fiche-card h6 {
  color: #4a90d9 !important;
}

/* Responsive: limiter la largeur sur mobile */
@media (max-width: 768px) {
  .fiche-card {
    max-width: 100% !important;
  }
  
  .fiche-card img {
    max-width: 100% !important;
    height: auto !important;
  }
}
