/* ========================================
   THÈME SOMBRE POUR REMISCORE - VERSION CORRIGÉE
   Élimination complète des fonds blancs
   ======================================== */

[data-theme="dark"] {
    --bs-body-bg: #0d1117 !important;
    --bs-body-color: #f0f6fc !important;
    --bs-primary: #58a6ff;
    --bs-secondary: #8b949e;
    --bs-success: #3fb950;
    --bs-danger: #f85149;
    --bs-warning: #d29922;
    --bs-info: #58a6ff;
    --bs-light: #21262d;
    --bs-dark: #010409;
    --bs-secondary-bg: #21262d;
    --bs-tertiary-bg: #30363d;
    --bs-secondary-color: #8b949e;
    --bs-tertiary-color: #6e7681;
    
    /* ÉLIMINATION COMPLÈTE DES FONDS BLANCS BOOTSTRAP */
    --bs-bg-opacity: 0 !important;
    --bs-white: #0d1117 !important;
    --bs-gray-100: #0d1117 !important;
    --bs-gray-200: #0d1117 !important;
    --bs-gray-300: #161b22 !important;
    --bs-light: #21262d !important;
    --bs-light-rgb: 13, 17, 23 !important;
}

/* ========================================
   FORCE BRUTE ANTI-FOND-BLANC
   ======================================== */

/* Éliminer absolument TOUS les fonds blancs possibles */
[data-theme="dark"] {
    background-color: #0d1117 !important;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important;
    color: #fcf0f0 !important;
}

/* ========================================
   RÈGLE GLOBALE ANTI-FOND-BLANC - VERSION CORRIGÉE
   ======================================== */

/* Forcer tous les éléments SAUF html et body à être transparents */
[data-theme="dark"] *:not(html):not(body) {
    background-color: transparent !important;
}

/* Restauration sélective des backgrounds nécessaires */
[data-theme="dark"] .card,
[data-theme="dark"] .podium-card,
[data-theme="dark"] .ranking-item,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .btn,
[data-theme="dark"] .navbar,
[data-theme="dark"] .toast,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .alert {
    background-color: revert !important;
}

/* Restauration spéciale pour les marches du podium */
[data-theme="dark"] .podium-base,
[data-theme="dark"] .podium-base-1,
[data-theme="dark"] .podium-base-2,
[data-theme="dark"] .podium-base-3 {
    background: unset !important;
}

/* ========================================
   LAYOUT GÉNÉRAL THÈME SOMBRE
   ======================================== */

[data-theme="dark"] html {
    background-color: #0d1117 !important;
    background: #0d1117 !important;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important;
    color: #fcf0f0 !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Forcer le body avec ses classes Bootstrap spécifiques - PRIORITÉ MAXIMALE */
html[data-theme="dark"] body,
html[data-theme="dark"] body.d-flex,
html[data-theme="dark"] body.flex-column,
html[data-theme="dark"] body.min-vh-100 {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important;
    color: #fcf0f0 !important;
}

[data-theme="dark"] html,
[data-theme="dark"] body {
    height: 100%;
}

[data-theme="dark"] main {
    flex: 1;
    background-color: transparent !important;
}

[data-theme="dark"] footer {
    margin-top: auto;
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%) !important;
    color: #fcf0f0;
    border-top: 1px solid #30363d;
}

/* ========================================
   ÉLIMINATION COMPLÈTE DES CONTENEURS BLANCS
   ======================================== */

[data-theme="dark"] .container,
[data-theme="dark"] .container-fluid,
[data-theme="dark"] .container-sm,
[data-theme="dark"] .container-md,
[data-theme="dark"] .container-lg,
[data-theme="dark"] .container-xl,
[data-theme="dark"] .container-xxl,
[data-theme="dark"] .row,
[data-theme="dark"] [class*="col-"],
[data-theme="dark"] .col,
[data-theme="dark"] main,
[data-theme="dark"] section,
[data-theme="dark"] article,
[data-theme="dark"] aside,
[data-theme="dark"] header,
[data-theme="dark"] div:not(.card):not(.podium-card):not(.ranking-item):not(.form-control):not(.btn):not(.navbar):not(.toast):not(.modal):not(.dropdown-menu):not(.alert) {
    background-color: transparent !important;
    background: none !important;
}

/* Règles spécifiques pour les classes Bootstrap communes */
[data-theme="dark"] .mt-1, [data-theme="dark"] .mt-2, [data-theme="dark"] .mt-3, [data-theme="dark"] .mt-4, [data-theme="dark"] .mt-5,
[data-theme="dark"] .mb-1, [data-theme="dark"] .mb-2, [data-theme="dark"] .mb-3, [data-theme="dark"] .mb-4, [data-theme="dark"] .mb-5,
[data-theme="dark"] .pt-1, [data-theme="dark"] .pt-2, [data-theme="dark"] .pt-3, [data-theme="dark"] .pt-4, [data-theme="dark"] .pt-5,
[data-theme="dark"] .pb-1, [data-theme="dark"] .pb-2, [data-theme="dark"] .pb-3, [data-theme="dark"] .pb-4, [data-theme="dark"] .pb-5,
[data-theme="dark"] .px-1, [data-theme="dark"] .px-2, [data-theme="dark"] .px-3, [data-theme="dark"] .px-4, [data-theme="dark"] .px-5,
[data-theme="dark"] .py-1, [data-theme="dark"] .py-2, [data-theme="dark"] .py-3, [data-theme="dark"] .py-4, [data-theme="dark"] .py-5 {
    background-color: transparent !important;
}

/* Classes Bootstrap flexbox et layout */
[data-theme="dark"] .d-flex,
[data-theme="dark"] .flex-column,
[data-theme="dark"] .min-vh-100,
[data-theme="dark"] .justify-content-center,
[data-theme="dark"] .align-items-center {
    background-color: transparent !important;
}

/* Élimination des backgrounds Bootstrap par défaut */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-body,
[data-theme="dark"] .bg-body-secondary,
[data-theme="dark"] .bg-body-tertiary {
    background-color: transparent !important;
}

/* ========================================
   POPUPS THÈME SOMBRE - DESIGN MODERNE
   ======================================== */

[data-theme="dark"] .popup {
    background-color: rgba(1, 4, 9, 0.85);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .popup-content {
    background: linear-gradient(135deg, #21262d 0%, #30363d 100%);
    border: 1px solid #30363d;
    color: #fcf0f0;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .close-btn {
    color: #8b949e;
    transition: color 0.2s ease;
}

[data-theme="dark"] .close-btn:hover,
[data-theme="dark"] .close-btn:focus {
    color: #f0f6fc;
    transform: scale(1.1);
}

/* ========================================
   NAVBAR THÈME SOMBRE - ÉLÉGANT
   ======================================== */

[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%) !important;
    border-bottom: 1px solid #30363d;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .navbar-brand,
[data-theme="dark"] .navbar-nav .nav-link {
    color: #f0f6fc !important;
    transition: color 0.2s ease;
}

[data-theme="dark"] .navbar-nav .nav-link:hover {
    color: #58a6ff !important;
    text-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

/* ========================================
   CARTES THÈME SOMBRE - DESIGN GLASSMORPHISM
   ======================================== */

[data-theme="dark"] .card {
    background: linear-gradient(135deg, rgba(33, 38, 45, 0.9) 0%, rgba(48, 54, 61, 0.7) 100%) !important;
    border: 1px solid rgba(48, 54, 61, 0.8);
    color: #f0f6fc !important;
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

[data-theme="dark"] .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(88, 166, 255, 0.3);
}

[data-theme="dark"] .card-body {
    background: transparent;
}

/* ========================================
   FORMULAIRES THÈME SOMBRE - MODERNE
   ======================================== */

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: linear-gradient(135deg, #21262d 0%, #30363d 100%);
    border: 1px solid #30363d;
    color: #f0f6fc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: linear-gradient(135deg, #30363d 0%, #21262d 100%);
    border-color: #58a6ff;
    color: #f0f6fc;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
}

[data-theme="dark"] .form-control::placeholder {
    color: #8b949e;
}

/* ========================================
   BOUTONS THÈME SOMBRE - ÉLÉGANTS
   ======================================== */

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(46, 160, 67, 0.3);
    transition: all 0.2s ease;
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #2ea043 0%, #238636 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 160, 67, 0.4);
}

[data-theme="dark"] .btn-outline-primary {
    color: #6f42c1;
    border-color: #6f42c1;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}

[data-theme="dark"] .btn-outline-success {
    color: #198754;
    border-color: #198754;
}

[data-theme="dark"] .btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
    color: #fff;
}

[data-theme="dark"] .alert-danger {
    background-color: #2c1618;
    border-color: #5c1e23;
    color: #ea868f;
}

[data-theme="dark"] .alert-success {
    background-color: #0f2419;
    border-color: #1e4b2c;
    color: #75b798;
}

[data-theme="dark"] .alert-warning {
    background-color: #332a00;
    border-color: #664d00;
    color: #ffecb3;
}

/* ========================================
   STYLES APPLE TOGGLE THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .apple-toggle .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

[data-theme="dark"] .apple-toggle .btn-check:checked + .btn-outline-primary,
[data-theme="dark"] .apple-toggle .btn-outline-primary.active {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: white;
}

[data-theme="dark"] .apple-toggle .btn-check:checked + .btn-outline-success,
[data-theme="dark"] .apple-toggle .btn-outline-success.active {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

[data-theme="dark"] .apple-toggle .btn {
    border-radius: 0;
    border-width: 1px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    background-color: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .apple-toggle .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

[data-theme="dark"] .apple-toggle .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* ========================================
   ANIMATION BOUNCE THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .podium-medal {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ========================================
   PODIUM THÈME SOMBRE - LUXUEUX AVEC ÉCLAIRAGE ARRIÈRE ET COULEURS
   ======================================== */

[data-theme="dark"] .podium-card {
    background: linear-gradient(135deg, rgba(33, 38, 45, 0.85) 0%, rgba(48, 54, 61, 0.75) 100%) !important;
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: #f0f6fc;
    backdrop-filter: blur(15px);
    border-radius: 20px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    
    /* Effet de lumière venant de derrière */
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 60px rgba(88, 166, 255, 0.15) !important;
}

/* Podium 1ère place - OR */
[data-theme="dark"] .podium-card:nth-child(2) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(218, 165, 32, 0.1) 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 215, 0, 0.2),
        0 0 60px rgba(255, 215, 0, 0.2) !important;
}

[data-theme="dark"] .podium-card:nth-child(2)::before {
    background: radial-gradient(
        circle at center,
        rgba(255, 215, 0, 0.1) 0%,
        rgba(255, 215, 0, 0.05) 30%,
        transparent 70%
    );
}

/* Podium 2ème place - ARGENT */
[data-theme="dark"] .podium-card:nth-child(1) {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, rgba(169, 169, 169, 0.1) 100%) !important;
    border: 1px solid rgba(192, 192, 192, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(192, 192, 192, 0.2),
        0 0 60px rgba(192, 192, 192, 0.15) !important;
}

[data-theme="dark"] .podium-card:nth-child(1)::before {
    background: radial-gradient(
        circle at center,
        rgba(192, 192, 192, 0.1) 0%,
        rgba(192, 192, 192, 0.05) 30%,
        transparent 70%
    );
}

/* Podium 3ème place - BRONZE */
[data-theme="dark"] .podium-card:nth-child(3) {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(184, 115, 51, 0.1) 100%) !important;
    border: 1px solid rgba(205, 127, 50, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(205, 127, 50, 0.2),
        0 0 60px rgba(205, 127, 50, 0.15) !important;
}

[data-theme="dark"] .podium-card:nth-child(3)::before {
    background: radial-gradient(
        circle at center,
        rgba(205, 127, 50, 0.1) 0%,
        rgba(205, 127, 50, 0.05) 30%,
        transparent 70%
    );
}

[data-theme="dark"] .podium-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(88, 166, 255, 0.1) 0%,
        rgba(88, 166, 255, 0.05) 30%,
        transparent 70%
    );
    z-index: -1;
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

[data-theme="dark"] .podium-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Hover spécifique pour chaque place */
[data-theme="dark"] .podium-card:nth-child(2):hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(218, 165, 32, 0.15) 100%) !important;
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 215, 0, 0.3),
        0 0 80px rgba(255, 215, 0, 0.3) !important;
}

[data-theme="dark"] .podium-card:nth-child(1):hover {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(169, 169, 169, 0.15) 100%) !important;
    border-color: rgba(192, 192, 192, 0.6);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(192, 192, 192, 0.3),
        0 0 80px rgba(192, 192, 192, 0.25) !important;
}

[data-theme="dark"] .podium-card:nth-child(3):hover {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(184, 115, 51, 0.15) 100%) !important;
    border-color: rgba(205, 127, 50, 0.6);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(205, 127, 50, 0.3),
        0 0 80px rgba(205, 127, 50, 0.25) !important;
}

/* Animation de pulsation pour l'éclairage */
@keyframes pulseGlow {
    from {
        opacity: 0.3;
        transform: scale(1);
    }
    to {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

[data-theme="dark"] .podium-medal {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    animation: bounce 2s infinite, medalGlow 3s ease-in-out infinite alternate;
}

[data-theme="dark"] .podium-rank {
    color: #f0f6fc;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(88, 166, 255, 0.3);
}

[data-theme="dark"] .podium-name {
    color: #f0f6fc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .podium-value {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4), 0 0 24px rgba(255, 215, 0, 0.2);
}

[data-theme="dark"] .podium-user {
    color: #8b949e;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Animation de lueur améliorée pour les médailles */
@keyframes medalGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    }
}

/* ========================================
   MARCHES COLORÉES DU PODIUM AVEC ÉCLAIRAGE
   ======================================== */

/* Base commune pour toutes les marches du podium */
[data-theme="dark"] .podium-base {
    border-radius: 12px;
    width: 100%;
    position: relative;
    margin: 0 auto;
    margin-top: 15px;
    border: 2px solid transparent;
    transition: all 0.4s ease;
    overflow: hidden;
}

[data-theme="dark"] .podium-base::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 12px;
    z-index: -1;
    transition: all 0.4s ease;
}

/* MARCHE OR pour 1ère place */
[data-theme="dark"] .podium-base-1 {
    height: 120px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffc107 100%) !important;
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid rgba(255, 215, 0, 0.8) !important;
}

[data-theme="dark"] .podium-base-1::before {
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.3) 0%, 
        transparent 25%, 
        rgba(255, 215, 0, 0.3) 50%, 
        transparent 75%, 
        rgba(255, 215, 0, 0.3) 100%);
    animation: shimmerGold 2s ease-in-out infinite;
}

[data-theme="dark"] .podium-base-1:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 215, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* MARCHE ARGENT pour 2ème place */
[data-theme="dark"] .podium-base-2 {
    height: 90px;
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #b8b8b8 100%) !important;
    box-shadow: 
        0 8px 25px rgba(192, 192, 192, 0.5),
        0 0 40px rgba(192, 192, 192, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid rgba(192, 192, 192, 0.8) !important;
}

[data-theme="dark"] .podium-base-2::before {
    background: linear-gradient(45deg, 
        rgba(192, 192, 192, 0.3) 0%, 
        transparent 25%, 
        rgba(192, 192, 192, 0.3) 50%, 
        transparent 75%, 
        rgba(192, 192, 192, 0.3) 100%);
    animation: shimmerSilver 2s ease-in-out infinite;
}

[data-theme="dark"] .podium-base-2:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(192, 192, 192, 0.7),
        0 0 60px rgba(192, 192, 192, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* MARCHE BRONZE pour 3ème place */
[data-theme="dark"] .podium-base-3 {
    height: 60px;
    background: linear-gradient(135deg, #cd7f32 0%, #daa357 50%, #b8732c 100%) !important;
    box-shadow: 
        0 8px 25px rgba(205, 127, 50, 0.5),
        0 0 40px rgba(205, 127, 50, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(205, 127, 50, 0.8) !important;
}

[data-theme="dark"] .podium-base-3::before {
    background: linear-gradient(45deg, 
        rgba(205, 127, 50, 0.3) 0%, 
        transparent 25%, 
        rgba(205, 127, 50, 0.3) 50%, 
        transparent 75%, 
        rgba(205, 127, 50, 0.3) 100%);
    animation: shimmerBronze 2s ease-in-out infinite;
}

[data-theme="dark"] .podium-base-3:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(205, 127, 50, 0.7),
        0 0 60px rgba(205, 127, 50, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Animations de scintillement pour chaque métal */
@keyframes shimmerGold {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes shimmerSilver {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.9; }
}

@keyframes shimmerBronze {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ========================================
   CLASSEMENT THÈME SOMBRE
   ======================================== */

/* ========================================
   CLASSEMENT THÈME SOMBRE - MODERNE
   ======================================== */

[data-theme="dark"] .ranking-item {
    background: linear-gradient(135deg, rgba(33, 38, 45, 0.8) 0%, rgba(48, 54, 61, 0.6) 100%);
    border: 1px solid rgba(48, 54, 61, 0.6);
    color: #f0f6fc;
    backdrop-filter: blur(8px);
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

[data-theme="dark"] .ranking-item:hover {
    background: linear-gradient(135deg, rgba(48, 54, 61, 0.9) 0%, rgba(33, 38, 45, 0.7) 100%);
    color: #f0f6fc;
    transform: translateX(8px) scale(1.02);
    border-color: rgba(88, 166, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .ranking-number {
    color: #58a6ff;
    text-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

[data-theme="dark"] .ranking-name {
    color: #f0f6fc;
}

[data-theme="dark"] .ranking-value {
    color: #8b949e;
}

[data-theme="dark"] .ranking-user {
    color: #6e7681;
}

/* ========================================
   ALERTES THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .alert-warning {
    background: linear-gradient(135deg, rgba(210, 153, 34, 0.15) 0%, rgba(210, 153, 34, 0.05) 100%);
    border: 1px solid rgba(210, 153, 34, 0.3);
    color: #d29922;
}

[data-theme="dark"] .alert-danger {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.15) 0%, rgba(248, 81, 73, 0.05) 100%);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f85149;
}

[data-theme="dark"] .alert-success {
    background: linear-gradient(135deg, rgba(63, 185, 80, 0.15) 0%, rgba(63, 185, 80, 0.05) 100%);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: #3fb950;
}

/* ========================================
   TABLEAUX THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .table {
    color: #e0e0e0;
}

[data-theme="dark"] .table-bordered {
    border-color: #333;
}

[data-theme="dark"] .table-bordered th,
[data-theme="dark"] .table-bordered td {
    border-color: #333;
}

[data-theme="dark"] .table thead th {
    background-color: #2c2c2c;
    border-color: #333;
}

[data-theme="dark"] .table tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   BOUTONS APPLE-STYLE THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .apple-toggle .btn-check:checked + .btn-outline-primary,
[data-theme="dark"] .apple-toggle .btn-outline-primary.active {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: white;
}

[data-theme="dark"] .apple-toggle .btn-check:checked + .btn-outline-success,
[data-theme="dark"] .apple-toggle .btn-outline-success.active {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

/* ========================================
   TOOLTIP THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .custom-tooltip .tooltip-inner {
    background-color: #1f1f1f;
    color: #e0e0e0;
    border: 1px solid #333;
}

[data-theme="dark"] .custom-tooltip .tooltip-arrow::before {
    border-top-color: #1f1f1f;
}

/* ========================================
   TRANSITIONS FLUIDES
   ======================================== */

body,
.card,
.form-control,
.form-select,
.btn,
.navbar,
.podium-card,
.ranking-item,
.table {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Toast personnalisés pour le thème sombre */
[data-theme="dark"] .toast {
    background-color: var(--bs-dark-bg-subtle);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .toast .toast-body {
    color: var(--bs-body-color);
}

[data-theme="dark"] .toast .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Animation d'entrée pour les toasts */
.toast {
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   TOOLTIPS THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .custom-tooltip .tooltip-inner {
    max-width: 350px;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-line;
    background: linear-gradient(135deg, #21262d 0%, #30363d 100%);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    color: #f0f6fc;
    border: 1px solid #30363d;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .custom-tooltip .tooltip-arrow::before {
    border-top-color: #21262d;
}

/* ========================================
   ANIMATIONS ET TRANSITIONS THÈME SOMBRE
   ======================================== */

[data-theme="dark"] .person-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(33, 38, 45, 0.6) 0%, rgba(48, 54, 61, 0.4) 100%);
    border: 1px solid rgba(48, 54, 61, 0.3);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .person-card.filtered-out {
    opacity: 0.2;
    transform: scale(0.95);
    pointer-events: none;
}

/* ========================================
   EFFETS SPÉCIAUX THÈME SOMBRE
   ======================================== */

/* Élimination complète des backgrounds blancs */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .table,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .offcanvas {
    background-color: #21262d !important;
    color: #f0f6fc !important;
}

/* Forcer le fond sombre sur tous les éléments Bootstrap potentiellement blancs */
[data-theme="dark"] .bg-body,
[data-theme="dark"] .bg-body-secondary,
[data-theme="dark"] .bg-body-tertiary {
    background-color: transparent !important;
}

/* Règle ULTIME pour éliminer TOUS les fonds blancs */
[data-theme="dark"] *:not(.card):not(.podium-card):not(.ranking-item):not(.form-control):not(.btn):not(.podium-base):not(.podium-base-1):not(.podium-base-2):not(.podium-base-3) {
    background-color: transparent !important;
}

/* Scrollbar personnalisée */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #21262d;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #30363d 0%, #58a6ff 100%);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #58a6ff 0%, #30363d 100%);
}

/* ========================================
   RÈGLE FINALE - PRIORITÉ ABSOLUE
   ======================================== */

/* Forcer spécifiquement les éléments de layout à être transparents */
[data-theme="dark"] div,
[data-theme="dark"] section,
[data-theme="dark"] article,
[data-theme="dark"] aside,
[data-theme="dark"] header,
[data-theme="dark"] main,
[data-theme="dark"] nav {
    background-color: transparent !important;
}

/* Forcer le fond sombre sur html et body avec priorité maximale */
[data-theme="dark"] html {
    background-color: #0d1117 !important;
    background: #0d1117 !important;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important;
    color: #fcf0f0 !important;
}

/* Restaurer les backgrounds des composants nécessaires */
[data-theme="dark"] .card,
[data-theme="dark"] .podium-card,
[data-theme="dark"] .ranking-item,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .btn,
[data-theme="dark"] .navbar,
[data-theme="dark"] .toast,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .alert,
[data-theme="dark"] footer {
    background-color: revert !important;
}

/* Restauration spéciale pour les marches du podium - avec couleurs */
[data-theme="dark"] .podium-base,
[data-theme="dark"] .podium-base-1,
[data-theme="dark"] .podium-base-2,
[data-theme="dark"] .podium-base-3 {
    background: unset !important;
}



/* ==========================================================
   PATCH: Podium — cartes entièrement colorées (or/argent/bronze)
   En thème sombre, basé sur la structure .podium-position.position-X .podium-card
   (corrige les anciens sélecteurs :nth-child qui ne s'appliquaient pas)
   ========================================================== */

[data-theme="dark"] .podium .position-1 .podium-card {
    /* OR sombre */
    background:
        radial-gradient(120% 80% at 80% 0%, rgba(255,205,92,.18) 0%, rgba(255,205,92,0) 60%),
        linear-gradient(180deg, #2a220c, #1b1606) !important;
    border-color: rgba(255,205,92,.35) !important;
    box-shadow:
        0 0 0 1px rgba(255,205,92,.12) inset,
        0 12px 40px rgba(255,205,92,.18),
        0 20px 40px rgba(0,0,0,.6) !important;
}

[data-theme="dark"] .podium .position-2 .podium-card {
    /* ARGENT sombre */
    background:
        radial-gradient(120% 80% at 80% 0%, rgba(207,214,227,.18) 0%, rgba(207,214,227,0) 60%),
        linear-gradient(180deg, #191d22, #121417) !important;
    border-color: rgba(207,214,227,.30) !important;
    box-shadow:
        0 0 0 1px rgba(207,214,227,.10) inset,
        0 12px 40px rgba(207,214,227,.16),
        0 20px 40px rgba(0,0,0,.6) !important;
}

[data-theme="dark"] .podium .position-3 .podium-card {
    /* BRONZE sombre */
    background:
        radial-gradient(120% 80% at 80% 0%, rgba(213,154,106,.16) 0%, rgba(213,154,106,0) 60%),
        linear-gradient(180deg, #241810, #1a120d) !important;
    border-color: rgba(213,154,106,.28) !important;
    box-shadow:
        0 0 0 1px rgba(213,154,106,.10) inset,
        0 12px 40px rgba(213,154,106,.14),
        0 20px 40px rgba(0,0,0,.6) !important;
}

/* Bouton dans la carte: laisser la couleur Bootstrap, mais on ajuste le contraste sur hover */
[data-theme="dark"] .podium .podium-card .btn {
    background-color: rgba(255,255,255,.06);
}
[data-theme="dark"] .podium .podium-card .btn:hover {
    background-color: rgba(255,255,255,.12);
}

/* Optionnel: couleur de la valeur/du rang pour rappeler la teinte */
[data-theme="dark"] .podium .position-1 .podium-card .podium-rank { color: #ffcd5c; }
[data-theme="dark"] .podium .position-2 .podium-card .podium-rank { color: #cfd6e3; }
[data-theme="dark"] .podium .position-3 .podium-card .podium-rank { color: #d59a6a; }

/* On neutralise les anciens styles basés sur :nth-child pour éviter les reflets colorés */
[data-theme="dark"] .podium-card:nth-child(1),
[data-theme="dark"] .podium-card:nth-child(2),
[data-theme="dark"] .podium-card:nth-child(3) {
    background: unset;
    border-color: inherit;
    box-shadow: none;
}

/* MARCHES DU PODIUM COLORÉES SELON LA POSITION */
[data-theme="dark"] .podium .position-1 .podium-base,
[data-theme="dark"] .podium .position-1 .podium-base-1 {
    /* MARCHE OR */
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffc107 100%) !important;
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid rgba(255, 215, 0, 0.8) !important;
}

[data-theme="dark"] .podium .position-2 .podium-base,
[data-theme="dark"] .podium .position-2 .podium-base-2 {
    /* MARCHE ARGENT */
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #b8b8b8 100%) !important;
    box-shadow: 
        0 8px 25px rgba(192, 192, 192, 0.5),
        0 0 40px rgba(192, 192, 192, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid rgba(192, 192, 192, 0.8) !important;
}

[data-theme="dark"] .podium .position-3 .podium-base,
[data-theme="dark"] .podium .position-3 .podium-base-3 {
    /* MARCHE BRONZE */
    background: linear-gradient(135deg, #cd7f32 0%, #daa357 50%, #b8732c 100%) !important;
    box-shadow: 
        0 8px 25px rgba(205, 127, 50, 0.5),
        0 0 40px rgba(205, 127, 50, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(205, 127, 50, 0.8) !important;
}

/* Animations de scintillement pour les marches selon position */
[data-theme="dark"] .podium .position-1 .podium-base::before,
[data-theme="dark"] .podium .position-1 .podium-base-1::before {
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.3) 0%, 
        transparent 25%, 
        rgba(255, 215, 0, 0.3) 50%, 
        transparent 75%, 
        rgba(255, 215, 0, 0.3) 100%);
    animation: shimmerGold 2s ease-in-out infinite;
}

[data-theme="dark"] .podium .position-2 .podium-base::before,
[data-theme="dark"] .podium .position-2 .podium-base-2::before {
    background: linear-gradient(45deg, 
        rgba(192, 192, 192, 0.3) 0%, 
        transparent 25%, 
        rgba(192, 192, 192, 0.3) 50%, 
        transparent 75%, 
        rgba(192, 192, 192, 0.3) 100%);
    animation: shimmerSilver 2s ease-in-out infinite;
}

[data-theme="dark"] .podium .position-3 .podium-base::before,
[data-theme="dark"] .podium .position-3 .podium-base-3::before {
    background: linear-gradient(45deg, 
        rgba(205, 127, 50, 0.3) 0%, 
        transparent 25%, 
        rgba(205, 127, 50, 0.3) 50%, 
        transparent 75%, 
        rgba(205, 127, 50, 0.3) 100%);
    animation: shimmerBronze 2s ease-in-out infinite;
}

/* ========================================================== */
