/* ARIANE  Mode sombre : toutes les surcharges html.dark-mode et dark-mode inputs */

        /* DARK MODE TOGGLE */
        .theme-toggle {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.5);
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 1.1em;
            transition: all 0.3s;
            margin-right: 8px;
        }

        .theme-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: white;
        }

        /* DARK MODE STYLES */
        html.dark-mode .login-card {
            background: var(--card-bg);
            color: var(--text-primary);
        }

        html.dark-mode .login-card h1 {
            color: #00d4ff;
        }

        html.dark-mode .login-card p {
            color: var(--text-secondary);
        }

        html.dark-mode .error-card {
            background: var(--card-bg);
            color: var(--text-primary);
        }

        html.dark-mode .error-card h1 {
            color: #ff6464;
        }

        html.dark-mode .error-card p,
        html.dark-mode .error-code {
            color: var(--text-secondary);
        }

        html.dark-mode .error-code {
            background: rgba(0, 0, 0, 0.3);
        }

        html.dark-mode .tabs {
            background: var(--tab-bg);
            color: var(--text-primary);
        }

        html.dark-mode .tab-button {
            background: var(--tab-inactive-bg);
            color: var(--text-primary);
        }

        html.dark-mode .tab-button.active {
            background: #667eea;
            color: white;
        }

        html.dark-mode .card {
            background: var(--card-bg);
            color: var(--text-primary);
            border: 1px solid rgba(0, 212, 255, 0.3);
            transition: all 0.3s ease;
        }

        html.dark-mode .card:hover {
            border-color: #00d4ff;
            box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
        }

        html.dark-mode .card h3 {
            color: var(--text-primary);
        }

        html.dark-mode .stat-box {
            background: rgba(0, 212, 255, 0.1);
            color: var(--text-primary);
            border: 1px solid rgba(0, 212, 255, 0.3);
            transition: all 0.3s ease;
        }

        html.dark-mode .stat-box:hover {
            border-color: #00d4ff;
            box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
        }

        html.dark-mode .grid-item {
            background: var(--card-bg);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }

        html.dark-mode canvas {
            filter: none;
        }

        html.dark-mode .chart-container {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 15px;
        }

        html.dark-mode .chart-container canvas {
            color: #ffffff !important;
        }

        html.dark-mode .heatmap-wrapper {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 15px;
        }

        html.dark-mode .heatmap {
            background: var(--card-bg);
        }

        html.dark-mode .heatmap-row-header {
            color: var(--text-primary);
        }

        html.dark-mode .range-controls {
            color: var(--text-primary);
        }

        html.dark-mode .card {
            color: var(--text-primary);
        }

        /* -- Mode sombre : plein écran carte DIRECT -- */
        html.dark-mode .btn-plein-ecran-ouvrir {
            border-color: rgba(0, 212, 255, 0.35);
            color: #00d4ff;
        }
        html.dark-mode .btn-plein-ecran-ouvrir:hover {
            background: rgba(0, 212, 255, 0.1);
        }
        html.dark-mode .card.card-plein-ecran {
            background: var(--card-bg) !important;
            border: none !important;
        }

        html.dark-mode .leaderboard li {
            background: linear-gradient(90deg, transparent 0%, rgba(0, 212, 255, 0.05) 100%);
            border-bottom-color: var(--border-color);
            color: var(--text-primary);
        }

        html.dark-mode .leaderboard-user {
            color: var(--text-primary);
        }

        html.dark-mode .leaderboard-count {
            color: #00d4ff;
        }

        html.dark-mode .range-btn {
            background: var(--card-bg);
            color: #00d4ff;
            border-color: #00d4ff;
        }

        html.dark-mode .range-btn.active {
            background: #00d4ff;
            color: #000;
            border-color: #00d4ff;
            box-shadow: 0 2px 8px rgba(0, 212, 255, 0.5);
        }

        html.dark-mode .range-btn:hover {
            background: rgba(0, 212, 255, 0.2);
        }


/*  Mode sombre : recherche  */

        /* SEARCH STYLES - DARK MODE */
        html.dark-mode #search-asin-input {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: rgba(102, 126, 234, 0.5) !important;
            color: #fff !important;
        }

        html.dark-mode #search-asin-input:-webkit-autofill,
        html.dark-mode #search-asin-input:-webkit-autofill:hover,
        html.dark-mode #search-asin-input:-webkit-autofill:focus,
        html.dark-mode #search-asin-input:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.08) inset !important;
            box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.08) inset !important;
            -webkit-text-fill-color: #fff !important;
            background: rgba(255, 255, 255, 0.08) !important;
        }

        html.dark-mode #search-asin-input::placeholder {
            color: #999 !important;
        }

        html.dark-mode #search-asin-input:focus {
            background: rgba(255, 255, 255, 0.12) !important;
            border-color: #667eea !important;
            box-shadow: 0 0 10px rgba(102, 126, 234, 0.3) !important;
            outline: none !important;
        }


/*  Mode sombre : calendrier semaine  */

        /* DARK MODE - WEEK CALENDAR */
        html.dark-mode .calendar-day-card {
            background: var(--card-bg);
            border-color: rgba(0, 212, 255, 0.3);
        }

        html.dark-mode .calendar-day-card:hover {
            border-color: #00d4ff;
            box-shadow: 0 10px 30px rgba(0, 212, 255, 0.15);
        }

        html.dark-mode .calendar-day-header {
            background: rgba(0, 212, 255, 0.1);
            color: #00d4ff;
            border: 1px solid rgba(0, 212, 255, 0.3);
        }

        html.dark-mode .calendar-day-name {
            color: white;
        }

        html.dark-mode .calendar-day-date {
            color: rgba(255, 255, 255, 0.8);
        }

        html.dark-mode .calendar-section-title {
            color: #00d4ff;
        }

        html.dark-mode .calendar-prediction-section {
            border-bottom-color: rgba(0, 212, 255, 0.2);
        }

        html.dark-mode .calendar-window {
            background: transparent;
            border-color: transparent;
            color: var(--text-primary);
        }

        html.dark-mode .calendar-window-time {
            color: var(--text-primary);
        }

        html.dark-mode .calendar-window-prob {
            color: #00d4ff;
        }

        html.dark-mode .calendar-no-data {
            background: rgba(0, 212, 255, 0.05);
            color: #aaa;
            border: 1px solid rgba(0, 212, 255, 0.2);
        }

        html.dark-mode .calendar-anomaly-badge {
            background: #ff4757;
        }

        html.dark-mode .calendar-anomaly-reason {
            color: #ff6b6b;
        }

        @media (max-width: 1400px) {
            .week-calendar-grid {
                grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
                gap: 10px;
            }
        }

        @media (max-width: 768px) {
            .week-calendar-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .calendar-day-card {
                margin-bottom: 10px;
            }
        }

