/**
 * Dark Mode centralisé pour le plugin Membres
 * Applique le dark mode automatiquement selon les préférences système
 * ou via la classe .dark-mode sur body
 */

/* ===========================
   STYLES GÉNÉRAUX DARK MODE
   =========================== */

/* Forcer le background du header en dark mode - Priorité maximale */
body.dark-mode header[style*="background"],
body.dark-mode .site-header[style*="background"],
body.dark-mode #masthead[style*="background"],
body.dark-mode nav.navbar[style*="background"],
body.dark-mode .main-navigation[style*="background"],
body.dark-mode .elementor-location-header[style*="background"] {
    background: #0f172a !important;
    background-color: #0f172a !important;
}

/* Tous les éléments header */
body.dark-mode header,
body.dark-mode header *:not(a):not(span):not(i),
body.dark-mode .site-header,
body.dark-mode .site-header *:not(a):not(span):not(i),
body.dark-mode #masthead,
body.dark-mode #masthead *:not(a):not(span):not(i),
body.dark-mode nav.navbar,
body.dark-mode .navbar *:not(a):not(span):not(i),
body.dark-mode .main-navigation,
body.dark-mode .elementor-location-header,
body.dark-mode .elementor-location-header > div,
body.dark-mode .elementor-location-header > section {
    background-color: #0f172a !important;
    background: #0f172a !important;
}

/* ===========================
   DARK MODE AUTO (Système)
   =========================== */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        background: #0b1220 !important;
        color: #e5e7eb !important;
    }
    
    /* Activités globales */
    body:not(.light-mode) .membres-composer-card,
    body:not(.light-mode) .membres-activity-card,
    body:not(.light-mode) .membres-sidebar-block {
        background: #0f172a !important;
        border-color: #334155 !important;
    }
    
    body:not(.light-mode) .membres-activity-body,
    body:not(.light-mode) .membres-activity-content,
    body:not(.light-mode) h1, body:not(.light-mode) h2, 
    body:not(.light-mode) h3, body:not(.light-mode) h4 {
        color: #e5e7eb !important;
    }
    
    body:not(.light-mode) textarea,
    body:not(.light-mode) input[type="text"],
    body:not(.light-mode) input[type="email"],
    body:not(.light-mode) select {
        background: #0b1220 !important;
        border-color: #334155 !important;
        color: #e5e7eb !important;
    }
    
    body:not(.light-mode) a {
        color: #93c5fd !important;
    }
    
    body:not(.light-mode) a:hover {
        color: #bfdbfe !important;
    }
    
    /* Événements et événements sidebar */
    body:not(.light-mode) .membres-events-block,
    body:not(.light-mode) .event-card {
        background: #0f172a !important;
        border-color: #334155 !important;
    }
    
    body:not(.light-mode) .event-card h3 {
        color: #e5e7eb !important;
    }
    
    /* Leaderboard */
    body:not(.light-mode) .membres-leaderboard-container > div {
        background: #0f172a !important;
    }
    
    body:not(.light-mode) .leaderboard-item {
        border-bottom-color: #334155 !important;
    }
    
    body:not(.light-mode) .leaderboard-item:hover {
        background: #1e293b !important;
    }
    
    /* Badges */
    body:not(.light-mode) .membres-badge,
    body:not(.light-mode) .membres-role-badge,
    body:not(.light-mode) .membres-tab-badge,
    body:not(.light-mode) .membres-page-badge,
    body:not(.light-mode) .session-badge {
        background: #1e293b !important;
        color: #e5e7eb !important;
    }
    
    /* Onglets */
    body:not(.light-mode) .membres-nav-tabs,
    body:not(.light-mode) .membres-profile-tabs {
        background: #0f172a !important;
        border-color: #334155 !important;
    }
    
    body:not(.light-mode) .membres-nav-tab,
    body:not(.light-mode) .membres-profile-tab {
        color: #94a3b8 !important;
    }
    
    body:not(.light-mode) .membres-nav-tab.active,
    body:not(.light-mode) .membres-profile-tab.active {
        background: #1e293b !important;
        color: #e5e7eb !important;
    }
    
    /* Header / Menu Navigation Principal */
    body:not(.light-mode) .site-header,
    body:not(.light-mode) header,
    body:not(.light-mode) .header,
    body:not(.light-mode) #masthead,
    body:not(.light-mode) nav.navbar,
    body:not(.light-mode) .main-navigation {
        background: #0f172a !important;
        border-bottom-color: #334155 !important;
    }
    
    body:not(.light-mode) .site-header a,
    body:not(.light-mode) header a,
    body:not(.light-mode) .main-navigation a,
    body:not(.light-mode) nav.navbar a,
    body:not(.light-mode) .menu a {
        color: #e5e7eb !important;
    }
    
    body:not(.light-mode) .site-header a:hover,
    body:not(.light-mode) header a:hover,
    body:not(.light-mode) .main-navigation a:hover,
    body:not(.light-mode) nav.navbar a:hover,
    body:not(.light-mode) .menu a:hover {
        color: #93c5fd !important;
    }
    
    body:not(.light-mode) .menu-item,
    body:not(.light-mode) .nav-item {
        border-color: #334155 !important;
    }
    
    body:not(.light-mode) .sub-menu,
    body:not(.light-mode) .dropdown-menu {
        background: #1e293b !important;
        border-color: #334155 !important;
    }
    
    /* Header overlay pages communautaires */
    body:not(.light-mode) .membres-user-header-overlay {
        background: rgba(15, 23, 42, 0.85) !important;
        color: #e5e7eb !important;
    }
    
    body:not(.light-mode) .membres-user-header-overlay h1 {
        color: #e5e7eb !important;
    }
    
    body:not(.light-mode) .membres-planning-day-title {
        color: #e5e7eb !important;
        background: #1e293b !important;
    }
    
    body:not(.light-mode) .membres-planning-event {
        background: #0f172a !important;
        border-color: #334155 !important;
    }
    
    /* Surcharge des styles inline */
    body:not(.light-mode) [style*="background:#fff"],
    body:not(.light-mode) [style*="background: #fff"],
    body:not(.light-mode) [style*="background:white"],
    body:not(.light-mode) [style*="background: white"] {
        background: #0f172a !important;
    }
    
    body:not(.light-mode) [style*="color:#0f172a"],
    body:not(.light-mode) [style*="color: #0f172a"],
    body:not(.light-mode) [style*="color:#222"],
    body:not(.light-mode) [style*="color: #222"] {
        color: #e5e7eb !important;
    }
    
    body:not(.light-mode) [style*="border:1px solid #e2e8f0"],
    body:not(.light-mode) [style*="border: 1px solid #e2e8f0"] {
        border-color: #334155 !important;
    }
    
    body:not(.light-mode) [style*="color:#64748b"],
    body:not(.light-mode) [style*="color: #64748b"],
    body:not(.light-mode) [style*="color:#555"],
    body:not(.light-mode) [style*="color: #555"] {
        color: #94a3b8 !important;
    }
    
    body:not(.light-mode) [style*="background:#f8fafc"],
    body:not(.light-mode) [style*="background: #f8fafc"] {
        background: #1e293b !important;
    }
    
    /* Cartes d'articles en mode auto */
    body:not(.light-mode) .elementor-post,
    body:not(.light-mode) .elementor-post__card,
    body:not(.light-mode) .elementor-post-card,
    body:not(.light-mode) .elementor-posts-container article,
    body:not(.light-mode) article.post,
    body:not(.light-mode) .post-card,
    body:not(.light-mode) .type-post,
    body:not(.light-mode) .hentry {
        background: #0f172a !important;
        border: 1px solid #334155 !important;
    }
    
    body:not(.light-mode) .elementor-post__title a,
    body:not(.light-mode) .entry-title a,
    body:not(.light-mode) article h2 a,
    body:not(.light-mode) article h3 a {
        color: #93c5fd !important;
    }
    
    body:not(.light-mode) .elementor-post__excerpt,
    body:not(.light-mode) .entry-summary,
    body:not(.light-mode) .entry-content,
    body:not(.light-mode) article p {
        color: #cbd5e1 !important;
    }
    
    body:not(.light-mode) .elementor-post__meta-data,
    body:not(.light-mode) .entry-meta,
    body:not(.light-mode) .post-meta {
        color: #94a3b8 !important;
    }
}

/* ===========================
   DARK MODE MANUEL (.dark-mode)
   =========================== */
   
/* Body et conteneurs principaux */
body.dark-mode {
    background: #0b1220 !important;
    color: #e5e7eb !important;
}

/* Header / Menu Navigation Principal */
body.dark-mode .site-header,
body.dark-mode header,
body.dark-mode .header,
body.dark-mode #masthead,
body.dark-mode nav.navbar,
body.dark-mode .main-navigation,
body.dark-mode .site-header-wrapper,
body.dark-mode .header-wrapper,
body.dark-mode #site-navigation,
body.dark-mode .navbar-collapse,
body.dark-mode .elementor-location-header {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .site-header *,
body.dark-mode header *,
body.dark-mode .main-navigation *,
body.dark-mode nav.navbar *,
body.dark-mode .elementor-location-header * {
    border-color: #334155 !important;
}

body.dark-mode .site-header a,
body.dark-mode header a,
body.dark-mode .main-navigation a,
body.dark-mode nav.navbar a,
body.dark-mode .menu a,
body.dark-mode .navbar-nav a,
body.dark-mode .site-branding a,
body.dark-mode .elementor-location-header a,
body.dark-mode .elementor-nav-menu a {
    color: #e5e7eb !important;
}

body.dark-mode .site-header a:hover,
body.dark-mode header a:hover,
body.dark-mode .main-navigation a:hover,
body.dark-mode nav.navbar a:hover,
body.dark-mode .menu a:hover,
body.dark-mode .navbar-nav a:hover,
body.dark-mode .elementor-location-header a:hover,
body.dark-mode .elementor-nav-menu a:hover {
    color: #93c5fd !important;
}

body.dark-mode .site-title,
body.dark-mode .site-title a,
body.dark-mode .site-description,
body.dark-mode .navbar-brand {
    color: #f1f5f9 !important;
}

body.dark-mode .menu-item,
body.dark-mode .nav-item {
    border-color: #334155 !important;
}

body.dark-mode .sub-menu,
body.dark-mode .dropdown-menu {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .menu-toggle,
body.dark-mode .navbar-toggler {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* Hamburger icon pour mobile */
body.dark-mode .menu-toggle span,
body.dark-mode .navbar-toggler-icon {
    background-color: #f1f5f9 !important;
}

/* Cartes et blocs */
body.dark-mode .membres-composer-card,
body.dark-mode .membres-activity-card,
body.dark-mode .membres-sidebar-block,
body.dark-mode .membres-edit-page-wrapper,
body.dark-mode .membres-manage-page-card,
body.dark-mode .membres-profile-card,
body.dark-mode .membres-community-card,
body.dark-mode .membres-vod-card,
body.dark-mode .membres-game-card {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Titres */
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: #e5e7eb !important;
}

/* Textes */
body.dark-mode p,
body.dark-mode span,
body.dark-mode .membres-activity-body,
body.dark-mode .membres-activity-content,
body.dark-mode label {
    color: #e5e7eb !important;
}

/* Textes secondaires */
body.dark-mode .membres-activity-meta,
body.dark-mode .membres-user-login,
body.dark-mode small {
    color: #9ca3af !important;
}

/* Formulaires */
body.dark-mode textarea,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="url"],
body.dark-mode input[type="number"],
body.dark-mode select {
    background: #0b1220 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

body.dark-mode textarea::placeholder,
body.dark-mode input::placeholder {
    color: #6b7280 !important;
}

/* Boutons primaires */
body.dark-mode .membres-btn-primary,
body.dark-mode button[type="submit"],
body.dark-mode .wp-block-button__link {
    background: #1d4ed8 !important;
    color: #fff !important;
    border-color: #1e40af !important;
}

body.dark-mode .membres-btn-primary:hover,
body.dark-mode button[type="submit"]:hover {
    background: #1e40af !important;
}

/* Boutons secondaires */
body.dark-mode .membres-btn-secondary,
body.dark-mode button[type="button"] {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-btn-secondary:hover,
body.dark-mode button[type="button"]:hover {
    background: #1f2937 !important;
    color: #93c5fd !important;
}

/* Liens */
body.dark-mode a {
    color: #93c5fd !important;
}

body.dark-mode a:hover {
    color: #bfdbfe !important;
}

/* Borders */
body.dark-mode .membres-activity-header,
body.dark-mode .membres-activity-footer,
body.dark-mode .membres-user-footer {
    border-color: #334155 !important;
}

/* Composer & Commentaires */
body.dark-mode #global-activity-content,
body.dark-mode .comment-text {
    background: #0b1220 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

/* Panels */
body.dark-mode #composer-mood-panel,
body.dark-mode #emoji-panel,
body.dark-mode .membres-modal {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Tabs */
body.dark-mode .membres-tabs,
body.dark-mode .membres-tab-content {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-tab-btn {
    background: #111827 !important;
    color: #9ca3af !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-tab-btn:hover,
body.dark-mode .membres-tab-btn.active {
    background: #1f2937 !important;
    color: #93c5fd !important;
}

/* Header profil */
body.dark-mode .membres-user-header-overlay {
    background: linear-gradient(
        to bottom,
        rgba(15, 23, 42, 0.75),
        rgba(11, 18, 32, 0.95)
    ) !important;
}

/* Badges */
body.dark-mode .membres-badge,
body.dark-mode .membres-status-indicator {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

/* Erreurs */
body.dark-mode .membres-error,
body.dark-mode #global-activity-error {
    background: #2a0f12 !important;
    border-color: #7f1d1d !important;
    color: #fecaca !important;
}

/* Success */
body.dark-mode .membres-success {
    background: #0f2a1a !important;
    border-color: #166534 !important;
    color: #bbf7d0 !important;
}

/* Footer Elementor */
body.dark-mode footer,
body.dark-mode .elementor,
body.dark-mode .elementor-widget-container {
    background: #0f172a !important;
    color: #e5e7eb !important;
}

body.dark-mode footer a,
body.dark-mode .elementor a {
    color: #93c5fd !important;
}

body.dark-mode footer a:hover,
body.dark-mode .elementor a:hover {
    color: #bfdbfe !important;
}

/* Roue quotidienne */
body.dark-mode .membres-wheel-container {
    background: linear-gradient(135deg, #1e3a8a 0%, #581c87 100%) !important;
}

body.dark-mode .membres-wheel-wrapper,
body.dark-mode .membres-wheel-stat {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-wheel-title {
    color: #e5e7eb !important;
}

/* Messages */
body.dark-mode .membres-messages-wrapper,
body.dark-mode .membres-conversation-item,
body.dark-mode .membres-message-item {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

body.dark-mode .membres-message-input {
    background: #0b1220 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

/* Pages communautaires */
body.dark-mode .membres-community-header,
body.dark-mode .membres-community-content {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-community-stat {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

body.dark-mode .membres-user-header-overlay {
    background: rgba(15, 23, 42, 0.85) !important;
    color: #e5e7eb !important;
}

body.dark-mode .membres-user-header-overlay h1 {
    color: #e5e7eb !important;
}

body.dark-mode .membres-user-login {
    color: #94a3b8 !important;
}

body.dark-mode .membres-user-description {
    color: #cbd5e1 !important;
}

/* Événements */
body.dark-mode .membres-events-block,
body.dark-mode .membres-sidebar-block {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-events-block h4,
body.dark-mode .membres-sidebar-block h4 {
    color: #e5e7eb !important;
}

body.dark-mode .membres-events-block a,
body.dark-mode .event-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

body.dark-mode .event-card h3 {
    color: #e5e7eb !important;
}

body.dark-mode .event-card div {
    color: #94a3b8 !important;
}

/* Leaderboard */
body.dark-mode .membres-leaderboard-container > div:first-child h1 {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

body.dark-mode .membres-leaderboard-container > div:first-child p {
    color: #94a3b8 !important;
}

body.dark-mode .leaderboard-filter-btn {
    background: transparent !important;
}

body.dark-mode .leaderboard-filter-btn:not(.active) {
    color: inherit !important;
}

body.dark-mode #podium,
body.dark-mode #leaderboard-list {
    background: #0f172a !important;
    color: #e5e7eb !important;
}

body.dark-mode .leaderboard-item {
    border-bottom-color: #334155 !important;
}

body.dark-mode .leaderboard-item:hover {
    background: #1e293b !important;
}

body.dark-mode .podium-card {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%) !important;
}

/* Badges */
body.dark-mode .membres-badge,
body.dark-mode .membres-role-badge,
body.dark-mode .membres-tab-badge,
body.dark-mode .membres-games-badge,
body.dark-mode .membres-page-badge,
body.dark-mode .membres-page-card-badge,
body.dark-mode .session-badge,
body.dark-mode .membres-planning-badge-today {
    background: #1e293b !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Onglets pages communautaires */
body.dark-mode .membres-nav-tabs,
body.dark-mode .membres-profile-tabs {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-nav-tab,
body.dark-mode .membres-profile-tab {
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-nav-tab:hover,
body.dark-mode .membres-profile-tab:hover {
    background: #1e293b !important;
    color: #e5e7eb !important;
}

body.dark-mode .membres-nav-tab.active,
body.dark-mode .membres-profile-tab.active {
    background: #1e293b !important;
    color: #e5e7eb !important;
    border-bottom-color: #8b5cf6 !important;
}

/* Contenu des onglets */
body.dark-mode .membres-tab-content {
    background: #0f172a !important;
    color: #e5e7eb !important;
}

body.dark-mode .membres-planning-day-title {
    color: #e5e7eb !important;
    background: #1e293b !important;
}

body.dark-mode .membres-planning-event {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

/* Surcharge des styles inline avec couleurs fixes */
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: white"] {
    background: #0f172a !important;
}

body.dark-mode [style*="color:#0f172a"],
body.dark-mode [style*="color: #0f172a"],
body.dark-mode [style*="color:#222"],
body.dark-mode [style*="color: #222"],
body.dark-mode [style*="color:#333"],
body.dark-mode [style*="color: #333"] {
    color: #e5e7eb !important;
}

body.dark-mode [style*="border:1px solid #e2e8f0"],
body.dark-mode [style*="border: 1px solid #e2e8f0"],
body.dark-mode [style*="border-color:#e2e8f0"],
body.dark-mode [style*="border-color: #e2e8f0"] {
    border-color: #334155 !important;
}

body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color:#555"],
body.dark-mode [style*="color: #555"] {
    color: #94a3b8 !important;
}

body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background: #f1f5f9"] {
    background: #1e293b !important;
}

/* Cibler spécifiquement les éléments avec classes identifiées */
body.dark-mode .membres-events-block > div > a,
body.dark-mode .membres-community-pages-block > div > a {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .membres-events-block > div > a:hover,
body.dark-mode .membres-community-pages-block > div > a:hover {
    background: #334155 !important;
}

/* Responsiveness */
@media (max-width: 768px) {
    body.dark-mode .membres-mobile-menu {
        background: #0f172a !important;
        border-color: #334155 !important;
    }
}

/* ===========================
   FORMULAIRES CONNEXION/INSCRIPTION
   =========================== */

/* Wrapper des formulaires */
body.dark-mode .membres-login-form-wrapper,
body.dark-mode .membres-register-form-wrapper {
    background: transparent !important;
}

/* Formulaires */
body.dark-mode .membres-login-form,
body.dark-mode .membres-register-form {
    background: #1e293b !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid #334155 !important;
}

/* En-tête des formulaires */
body.dark-mode .membres-form-header h2 {
    color: #f1f5f9 !important;
}

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

/* Icône du formulaire - garde le gradient */
body.dark-mode .membres-form-icon {
    /* Le gradient reste visible */
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6) !important;
}

/* Labels */
body.dark-mode .membres-form-group label {
    color: #cbd5e1 !important;
}

/* Inputs, textarea, select */
body.dark-mode .membres-form-control,
body.dark-mode .membres-login-form input[type="text"],
body.dark-mode .membres-login-form input[type="email"],
body.dark-mode .membres-login-form input[type="password"],
body.dark-mode .membres-register-form input[type="text"],
body.dark-mode .membres-register-form input[type="email"],
body.dark-mode .membres-register-form input[type="password"] {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .membres-form-control:focus,
body.dark-mode .membres-login-form input:focus,
body.dark-mode .membres-register-form input:focus {
    background: #1e293b !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

body.dark-mode .membres-form-control::placeholder,
body.dark-mode .membres-login-form input::placeholder,
body.dark-mode .membres-register-form input::placeholder {
    color: #64748b !important;
}

/* Small text / hints */
body.dark-mode .membres-form-group small {
    color: #94a3b8 !important;
}

/* Bouton toggle password */
body.dark-mode .membres-toggle-password {
    color: #94a3b8 !important;
}

body.dark-mode .membres-toggle-password:hover {
    color: #667eea !important;
}

/* Lien mot de passe oublié */
body.dark-mode .membres-forgot-link {
    color: #818cf8 !important;
}

body.dark-mode .membres-forgot-link:hover {
    color: #a5b4fc !important;
}

/* Boutons primaires - garde le gradient */
body.dark-mode .membres-btn-primary {
    /* Le gradient reste visible et lumineux en dark mode */
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6) !important;
}

body.dark-mode .membres-btn-primary:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.7) !important;
}

/* Footer du formulaire */
body.dark-mode .membres-form-footer {
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-mode .membres-form-footer a {
    color: #818cf8 !important;
}

body.dark-mode .membres-form-footer a:hover {
    color: #a5b4fc !important;
}

/* Alerts / Messages */
body.dark-mode .membres-alert {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .membres-alert-error {
    background: #7f1d1d !important;
    border-color: #991b1b !important;
    color: #fecaca !important;
}

body.dark-mode .membres-alert-success {
    background: #14532d !important;
    border-color: #166534 !important;
    color: #bbf7d0 !important;
}

/* reCAPTCHA container */
body.dark-mode .g-recaptcha {
    filter: invert(0.88) hue-rotate(180deg);
    border-radius: 4px;
}

/* Formulaire d'inscription - icône spécifique */
body.dark-mode .membres-register-form .membres-form-icon {
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.6) !important;
}

/* Assurer que les inputs du formulaire de register ont le bon style */
body.dark-mode .membres-register-form .membres-form-control:focus {
    border-color: #f5576c !important;
    box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.2) !important;
}

/* ===========================
   MODALES CONNEXION/INSCRIPTION (Widget Header)
   =========================== */

/* Overlay de la modale */
body.dark-mode .membres-auth-overlay {
    background: rgba(0, 0, 0, 0.85) !important;
}

/* Container de la modale */
body.dark-mode .membres-auth-container {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

/* Bouton de fermeture */
body.dark-mode .membres-auth-close-btn {
    color: #94a3b8 !important;
}

body.dark-mode .membres-auth-close-btn:hover {
    color: #f1f5f9 !important;
}

/* Titres des formulaires dans la modale */
body.dark-mode #members-login-form h3,
body.dark-mode #members-register-form h3 {
    color: #f1f5f9 !important;
}

/* Messages d'erreur/succès dans la modale */
body.dark-mode .membres-auth-message.membres-auth-message-error {
    background: #7f1d1d !important;
    border-color: #991b1b !important;
    color: #fecaca !important;
}

body.dark-mode .membres-auth-message.membres-auth-message-success {
    background: #14532d !important;
    border-color: #166534 !important;
    color: #bbf7d0 !important;
}

/* Inputs dans la modale */
body.dark-mode .membres-input-small,
body.dark-mode .membres-auth-container input[type="text"],
body.dark-mode .membres-auth-container input[type="email"],
body.dark-mode .membres-auth-container input[type="password"] {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .membres-input-small:focus,
body.dark-mode .membres-auth-container input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    background: #1e293b !important;
}

body.dark-mode .membres-input-small::placeholder,
body.dark-mode .membres-auth-container input::placeholder {
    color: #64748b !important;
}

/* Boutons dans la modale */
body.dark-mode .membres-btn-primary-small {
    /* Garde le gradient bleu */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

body.dark-mode .membres-btn-primary-small:hover {
    opacity: 0.9;
}

body.dark-mode .membres-btn-secondary-small {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

body.dark-mode .membres-btn-secondary-small:hover {
    background: #475569 !important;
}

/* Toggle password dans la modale */
body.dark-mode .membres-toggle-password-small {
    color: #94a3b8 !important;
}

body.dark-mode .membres-toggle-password-small:hover {
    color: #667eea !important;
}

body.dark-mode .membres-toggle-password-small:focus {
    outline-color: #667eea !important;
}

/* Texte de toggle entre connexion/inscription */
body.dark-mode .membres-auth-toggle {
    color: #94a3b8 !important;
}

body.dark-mode .membres-auth-toggle-btn {
    color: #818cf8 !important;
    background: transparent !important;
}

body.dark-mode .membres-auth-toggle-btn:hover {
    color: #a5b4fc !important;
    text-decoration: underline;
}

/* Boutons sociaux (Discord, Twitch) */
body.dark-mode .membres-social-login {
    border-top-color: #334155 !important;
}

body.dark-mode .membres-btn-social {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

body.dark-mode .membres-btn-social:hover {
    background: #475569 !important;
}

body.dark-mode .membres-btn-discord {
    background: #5865F2 !important;
    border-color: #5865F2 !important;
}

body.dark-mode .membres-btn-discord:hover {
    background: #4752c4 !important;
}

body.dark-mode .membres-btn-twitch {
    background: #9146FF !important;
    border-color: #9146FF !important;
}

body.dark-mode .membres-btn-twitch:hover {
    background: #772ce8 !important;
}

body.dark-mode .membres-social-hint {
    color: #94a3b8 !important;
}

/* Formulaire de "mot de passe oublié" */
body.dark-mode .membres-forgot-link-small {
    color: #818cf8 !important;
}

body.dark-mode .membres-forgot-link-small:hover {
    color: #a5b4fc !important;
}
/* ===========================
   ELEMENTOR - DARK MODE GLOBAL
   =========================== */

/* Sections et conteneurs Elementor */
body.dark-mode .elementor,
body.dark-mode .elementor-section,
body.dark-mode .elementor-container,
body.dark-mode .elementor-column,
body.dark-mode .elementor-widget-wrap,
body.dark-mode .elementor-element {
    background-color: transparent !important;
}

/* Widgets Elementor - Arrière-plans */
body.dark-mode .elementor-widget-container,
body.dark-mode .elementor-text-editor,
body.dark-mode .elementor-heading-title,
body.dark-mode .elementor-widget-heading,
body.dark-mode .elementor-widget-text-editor {
    color: #e5e7eb !important;
}

/* Titres Elementor */
body.dark-mode .elementor h1,
body.dark-mode .elementor h2,
body.dark-mode .elementor h3,
body.dark-mode .elementor h4,
body.dark-mode .elementor h5,
body.dark-mode .elementor h6,
body.dark-mode .elementor-heading-title {
    color: #f1f5f9 !important;
}

/* Textes Elementor */
body.dark-mode .elementor p,
body.dark-mode .elementor span:not(.elementor-button),
body.dark-mode .elementor li,
body.dark-mode .elementor-text-editor {
    color: #cbd5e1 !important;
}

/* Liens Elementor */
body.dark-mode .elementor a:not(.elementor-button) {
    color: #93c5fd !important;
}

body.dark-mode .elementor a:not(.elementor-button):hover {
    color: #bfdbfe !important;
}

/* Widgets spécifiques Elementor */
body.dark-mode .elementor-icon-box,
body.dark-mode .elementor-image-box,
body.dark-mode .elementor-cta {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Cartes et blocs Elementor */
body.dark-mode .elementor-widget-image-box .elementor-image-box-content,
body.dark-mode .elementor-widget-icon-box .elementor-icon-box-content {
    color: #cbd5e1 !important;
}

/* Formulaires Elementor */
body.dark-mode .elementor-field-group input,
body.dark-mode .elementor-field-group textarea,
body.dark-mode .elementor-field-group select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .elementor-field-group input::placeholder,
body.dark-mode .elementor-field-group textarea::placeholder {
    color: #64748b !important;
}

body.dark-mode .elementor-field-group label {
    color: #cbd5e1 !important;
}

/* Boutons Elementor - seulement si ce n'est pas un bouton avec style personnalisé */
body.dark-mode .elementor-button:not([style*="background"]) {
    background: #1d4ed8 !important;
    color: #fff !important;
}

/* Accordéons et Tabs Elementor */
body.dark-mode .elementor-accordion .elementor-tab-title,
body.dark-mode .elementor-toggle .elementor-tab-title,
body.dark-mode .elementor-tabs-wrapper {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .elementor-accordion .elementor-tab-content,
body.dark-mode .elementor-toggle .elementor-tab-content,
body.dark-mode .elementor-tab-content {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-mode .elementor-tab-title.elementor-active {
    background: #334155 !important;
}

/* ===========================
   WORDPRESS GLOBAL - DARK MODE
   =========================== */

/* Corps de page WordPress */
body.dark-mode .site-main,
body.dark-mode .content-area,
body.dark-mode article,
body.dark-mode .entry-content {
    background-color: transparent !important;
    color: #e5e7eb !important;
}

/* Conteneurs principaux */
body.dark-mode .site,
body.dark-mode #page,
body.dark-mode #content,
body.dark-mode .site-content {
    background: #0b1220 !important;
}

/* Sidebar WordPress */
body.dark-mode .sidebar,
body.dark-mode .widget-area,
body.dark-mode aside {
    background: #0f172a !important;
}

body.dark-mode .widget {
    background: #1e293b !important;
    border-color: #334155 !important;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

body.dark-mode .widget-title,
body.dark-mode .widgettitle {
    color: #f1f5f9 !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .widget ul li {
    border-color: #334155 !important;
}

body.dark-mode .widget a {
    color: #93c5fd !important;
}

body.dark-mode .widget a:hover {
    color: #bfdbfe !important;
}

/* Articles WordPress */
body.dark-mode .entry-header,
body.dark-mode .entry-title,
body.dark-mode .page-title {
    color: #f1f5f9 !important;
}

body.dark-mode .entry-meta,
body.dark-mode .entry-footer,
body.dark-mode .post-meta {
    color: #94a3b8 !important;
}

body.dark-mode .entry-content p,
body.dark-mode .entry-content li,
body.dark-mode .entry-content blockquote {
    color: #cbd5e1 !important;
}

/* Blockquotes */
body.dark-mode blockquote {
    background: #1e293b !important;
    border-left-color: #667eea !important;
    color: #cbd5e1 !important;
}

/* Code blocks */
body.dark-mode pre,
body.dark-mode code {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* Tables */
body.dark-mode table {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode th,
body.dark-mode td {
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

body.dark-mode thead,
body.dark-mode th {
    background: #0f172a !important;
    color: #f1f5f9 !important;
}

body.dark-mode tbody tr:hover {
    background: #334155 !important;
}

/* Commentaires WordPress */
body.dark-mode .comments-area,
body.dark-mode .comment-list,
body.dark-mode .comment-body {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .comment-author,
body.dark-mode .comment-metadata {
    color: #f1f5f9 !important;
}

body.dark-mode .comment-content {
    color: #cbd5e1 !important;
}

body.dark-mode .comment-reply-link {
    background: #1e293b !important;
    color: #93c5fd !important;
    border-color: #334155 !important;
}

body.dark-mode .comment-reply-link:hover {
    background: #334155 !important;
    color: #bfdbfe !important;
}

/* Formulaire de commentaires */
body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .comment-form input::placeholder,
body.dark-mode .comment-form textarea::placeholder {
    color: #64748b !important;
}

body.dark-mode .comment-form label {
    color: #cbd5e1 !important;
}

/* Pagination WordPress */
body.dark-mode .pagination,
body.dark-mode .nav-links {
    background: #0f172a !important;
}

body.dark-mode .page-numbers,
body.dark-mode .nav-links a {
    background: #1e293b !important;
    color: #93c5fd !important;
    border-color: #334155 !important;
}

body.dark-mode .page-numbers:hover,
body.dark-mode .nav-links a:hover {
    background: #334155 !important;
    color: #bfdbfe !important;
}

body.dark-mode .page-numbers.current {
    background: #1d4ed8 !important;
    color: #fff !important;
}

/* Footer WordPress */
body.dark-mode .site-footer,
body.dark-mode footer.footer,
body.dark-mode #colophon {
    background: #0f172a !important;
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-mode .site-footer h1,
body.dark-mode .site-footer h2,
body.dark-mode .site-footer h3,
body.dark-mode .site-footer h4 {
    color: #f1f5f9 !important;
}

body.dark-mode .site-footer a {
    color: #93c5fd !important;
}

body.dark-mode .site-footer a:hover {
    color: #bfdbfe !important;
}

/* Recherche WordPress */
body.dark-mode .search-form input[type="search"] {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .search-form button,
body.dark-mode .search-form input[type="submit"] {
    background: #1d4ed8 !important;
    color: #fff !important;
}

/* Archives et listes */
body.dark-mode .archive-header,
body.dark-mode .page-header {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .archive-title,
body.dark-mode .archive-description {
    color: #f1f5f9 !important;
}

/* ===========================
   PAGES ACTUALITÉS (BLOG)
   =========================== */

/* Grille d'articles */
body.dark-mode .blog .hentry,
body.dark-mode .archive .hentry,
body.dark-mode .post-grid .post,
body.dark-mode .posts-container .post {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Miniatures d'articles */
body.dark-mode .post-thumbnail,
body.dark-mode .entry-thumbnail {
    border-radius: 8px;
    overflow: hidden;
}

/* Catégories et tags */
body.dark-mode .cat-links,
body.dark-mode .tags-links,
body.dark-mode .category-badge,
body.dark-mode .post-categories {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .cat-links a,
body.dark-mode .tags-links a,
body.dark-mode .post-categories a {
    color: #93c5fd !important;
}

body.dark-mode .cat-links a:hover,
body.dark-mode .tags-links a:hover,
body.dark-mode .post-categories a:hover {
    color: #bfdbfe !important;
}

/* Cartes d'articles Elementor */
body.dark-mode .elementor-post,
body.dark-mode .elementor-post__card,
body.dark-mode .elementor-post-card,
body.dark-mode .elementor-posts-container article,
body.dark-mode .elementor-post-wrapper,
body.dark-mode .post-card,
body.dark-mode article.post,
body.dark-mode .wp-block-post,
body.dark-mode .type-post {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
}

/* Titres dans les cartes */
body.dark-mode .elementor-post__title,
body.dark-mode .elementor-post__title a,
body.dark-mode .entry-title a,
body.dark-mode article h2 a,
body.dark-mode article h3 a,
body.dark-mode .post-card h2,
body.dark-mode .post-card h3 {
    color: #93c5fd !important;
}

body.dark-mode .elementor-post__title a:hover,
body.dark-mode .entry-title a:hover,
body.dark-mode article h2 a:hover,
body.dark-mode article h3 a:hover {
    color: #bfdbfe !important;
}

/* Texte/extrait dans les cartes */
body.dark-mode .elementor-post__excerpt,
body.dark-mode .elementor-post__text,
body.dark-mode .entry-summary,
body.dark-mode .entry-content,
body.dark-mode article p,
body.dark-mode .post-card p {
    color: #cbd5e1 !important;
}

/* Meta (date, auteur, etc.) dans les cartes */
body.dark-mode .elementor-post__meta-data,
body.dark-mode .elementor-post-date,
body.dark-mode .elementor-post-author,
body.dark-mode .posted-on,
body.dark-mode .byline,
body.dark-mode .entry-meta,
body.dark-mode .post-meta,
body.dark-mode article .meta {
    color: #94a3b8 !important;
}

/* Liens "Lire la suite" */
body.dark-mode .elementor-post__read-more,
body.dark-mode .more-link,
body.dark-mode .read-more,
body.dark-mode article .btn-link {
    color: #93c5fd !important;
    background: transparent !important;
}

body.dark-mode .elementor-post__read-more:hover,
body.dark-mode .more-link:hover,
body.dark-mode .read-more:hover {
    color: #bfdbfe !important;
}

/* Badges catégories dans les cartes */
body.dark-mode .elementor-post__badge,
body.dark-mode .post-categories a,
body.dark-mode .cat-links a {
    background: #1e293b !important;
    color: #93c5fd !important;
    border: 1px solid #334155 !important;
}

/* Images dans les cartes */
body.dark-mode .elementor-post__thumbnail,
body.dark-mode .post-thumbnail img,
body.dark-mode article img {
    border-radius: 8px;
}

/* Séparateurs entre cartes */
body.dark-mode .elementor-posts-container .elementor-post {
    border: 1px solid #334155 !important;
    margin-bottom: 20px;
}

/* Grilles d'articles */
body.dark-mode .elementor-posts,
body.dark-mode .posts-grid,
body.dark-mode .blog-posts {
    background: transparent !important;
}

/* ===========================
   ÉLÉMENTS SPÉCIFIQUES PAGES
   =========================== */

/* Forcer les conteneurs avec background blanc */
body.dark-mode [class*="container"],
body.dark-mode [class*="wrapper"],
body.dark-mode [class*="section"] {
    background-color: transparent !important;
}

/* Surcharge des styles inline communs */
body.dark-mode [style*="background-color: rgb(255, 255, 255)"],
body.dark-mode [style*="background-color:rgb(255, 255, 255)"],
body.dark-mode [style*="background-color: #ffffff"],
body.dark-mode [style*="background-color:#ffffff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#fff"] {
    background-color: #0f172a !important;
}

body.dark-mode [style*="color: rgb(0, 0, 0)"],
body.dark-mode [style*="color:rgb(0, 0, 0)"],
body.dark-mode [style*="color: #000000"],
body.dark-mode [style*="color:#000000"],
body.dark-mode [style*="color: #000"],
body.dark-mode [style*="color:#000"] {
    color: #e5e7eb !important;
}

/* ===========================
   AMÉLIORATION DE LA LISIBILITÉ
   =========================== */

/* S'assurer que le texte principal est lisible */
body.dark-mode {
    line-height: 1.6;
}

/* Contraste optimal pour les petits textes */
body.dark-mode small,
body.dark-mode .small-text,
body.dark-mode .meta-info {
    color: #9ca3af !important;
    font-size: 0.875rem;
}

/* Améliorer les transitions */
body.dark-mode *,
body.dark-mode *::before,
body.dark-mode *::after {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Images - légère réduction d'opacité pour confort visuel */
body.dark-mode img:not(.no-dark-filter) {
    opacity: 0.9;
}

body.dark-mode img:hover {
    opacity: 1;
}

/* ===========================
   FIXES SPÉCIFIQUES
   =========================== */

/* Assurer que les icônes FontAwesome restent visibles */
body.dark-mode i.fa,
body.dark-mode i.fas,
body.dark-mode i.far,
body.dark-mode i.fab {
    color: inherit;
}

/* Boutons colorés - préserver les styles Bootstrap/thème */
body.dark-mode .btn-success {
    background: #059669 !important;
    border-color: #047857 !important;
}

body.dark-mode .btn-danger {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
}

body.dark-mode .btn-warning {
    background: #d97706 !important;
    border-color: #b45309 !important;
    color: #fff !important;
}

body.dark-mode .btn-info {
    background: #0284c7 !important;
    border-color: #0369a1 !important;
}

/* ===========================
   RESPONSIVE DARK MODE
   =========================== */

@media (max-width: 768px) {
    /* Menu mobile */
    body.dark-mode .mobile-menu,
    body.dark-mode .menu-toggle-container,
    body.dark-mode .navbar-collapse {
        background: #0f172a !important;
        border-color: #334155 !important;
    }
    
    /* Ajustements pour mobile */
    body.dark-mode .elementor-section {
        padding: 20px 10px !important;
    }
}