/* ============================================
   OCI Express - Theme Toggle
   Mode Sombre / Clair
   ============================================ */

/* ============================================
   VARIABLES DU MODE CLAIR
   ============================================ */

[data-theme="light"] {
    /* Couleurs principales */
    --background: hsl(40, 30%, 97%);
    --foreground: hsl(220, 20%, 15%);

    /* Cartes */
    --card: hsl(40, 25%, 95%);
    --card-foreground: hsl(220, 20%, 15%);
    --card-border: hsl(40, 20%, 88%);

    /* Couleur primaire (or - reste similaire) */
    --primary: hsl(43, 89%, 45%);
    --primary-foreground: hsl(220, 20%, 10%);

    /* Couleurs secondaires */
    --secondary: hsl(40, 15%, 90%);
    --secondary-foreground: hsl(220, 15%, 30%);

    /* États */
    --muted: hsl(40, 15%, 85%);
    --muted-foreground: hsl(220, 10%, 45%);
    --accent: hsl(43, 60%, 90%);
    --accent-foreground: hsl(43, 89%, 35%);

    /* Bordures */
    --border: hsl(40, 20%, 85%);
    --input: hsl(40, 20%, 88%);

    /* États de succès/erreur */
    --success: hsl(142, 60%, 40%);
    --success-foreground: hsl(0, 0%, 100%);
    --error: hsl(0, 70%, 50%);
    --error-foreground: hsl(0, 0%, 100%);
    --warning: hsl(38, 92%, 45%);
    --warning-foreground: hsl(0, 0%, 100%);

    /* Ring */
    --ring: hsl(43, 89%, 45%);

    /* Ombres */
    --shadow-color: hsla(220, 20%, 15%, 0.08);
    --shadow-lg: 0 25px 50px -12px hsla(220, 20%, 15%, 0.15);
}

/* ============================================
   AJUSTEMENTS MODE CLAIR
   ============================================ */

[data-theme="light"] .navbar {
    background: hsla(40, 30%, 97%, 0.9);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .navbar.scrolled {
    background: hsla(40, 30%, 97%, 0.98);
    box-shadow: 0 4px 20px var(--shadow-color);
}

[data-theme="light"] .bento-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px var(--shadow-color);
}

[data-theme="light"] .bento-card:hover {
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 40px hsla(43, 89%, 50%, 0.2);
}

[data-theme="light"] .hero-overlay {
    background: linear-gradient(
        to bottom,
        hsla(40, 30%, 97%, 0.2) 0%,
        hsla(40, 30%, 97%, 0.4) 30%,
        hsla(40, 30%, 97%, 0.7) 60%,
        var(--background) 100%
    ) !important;
}

[data-theme="light"] .text-gradient-gold {
    background: linear-gradient(135deg, hsl(43, 89%, 40%) 0%, hsl(43, 89%, 55%) 50%, hsl(43, 89%, 40%) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .btn-gold {
    background: linear-gradient(135deg, hsl(43, 89%, 50%) 0%, hsl(43, 89%, 55%) 100%);
    color: hsl(220, 20%, 10%);
    box-shadow: 0 4px 15px hsla(43, 89%, 50%, 0.3);
}

[data-theme="light"] .btn-outline {
    border-color: var(--border);
    color: var(--foreground);
}

[data-theme="light"] .btn-outline:hover {
    background: var(--secondary);
    border-color: var(--primary);
}

[data-theme="light"] .btn-ghost {
    color: var(--foreground);
}

[data-theme="light"] .btn-ghost:hover {
    background: var(--secondary);
}

[data-theme="light"] .badge-gold {
    background: hsla(43, 89%, 50%, 0.15);
    border-color: hsla(43, 89%, 50%, 0.4);
    color: hsl(43, 89%, 35%);
}

[data-theme="light"] .feature-icon {
    background: hsla(43, 89%, 50%, 0.15);
}

[data-theme="light"] .pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 10px 40px hsla(43, 89%, 50%, 0.2);
}

[data-theme="light"] .footer {
    background: hsl(40, 20%, 93%);
    border-top: 1px solid var(--border);
}

[data-theme="light"] .mobile-menu {
    background: var(--background);
}

[data-theme="light"] .input {
    background: var(--input);
    border-color: var(--border);
    color: var(--foreground);
}

[data-theme="light"] .faq-item {
    background: var(--card);
}

[data-theme="light"] .cta-section {
    background: linear-gradient(
        135deg,
        hsl(40, 25%, 93%) 0%,
        hsl(43, 30%, 90%) 100%
    );
}

[data-theme="light"] .cta-bg {
    background: radial-gradient(
        ellipse at center,
        hsla(43, 89%, 50%, 0.1) 0%,
        transparent 70%
    );
}

[data-theme="light"] .section-divider {
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--border) 50%,
        transparent 100%
    );
}

/* Loader en mode clair */
[data-theme="light"] #loader {
    background: hsl(40, 30%, 97%);
}

[data-theme="light"] .loader-logo-text {
    background: linear-gradient(135deg, hsl(43, 89%, 40%) 0%, hsl(43, 89%, 50%) 50%, hsl(43, 89%, 40%) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .progress-track {
    background: hsl(40, 20%, 90%);
}

[data-theme="light"] .loader-text {
    color: hsl(220, 10%, 45%);
}

[data-theme="light"] .transition-overlay {
    background: linear-gradient(
        135deg,
        rgba(255, 248, 230, 0.95) 0%,
        rgba(255, 235, 180, 0.9) 50%,
        rgba(255, 248, 230, 0.85) 100%
    );
}

/* ============================================
   BOUTON TOGGLE
   ============================================ */

/* Toggle dans la navbar desktop */
.nav-buttons .theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: hsla(220, 16%, 18%, 0.8);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid hsla(43, 89%, 50%, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-width: 62px;
    min-height: 38px;
}

.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: var(--secondary);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* S'assurer que les enfants ne bloquent pas le clic */
.theme-toggle * {
    pointer-events: none;
}

.theme-toggle:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px hsla(43, 89%, 50%, 0.2);
}

.theme-toggle-track {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--muted);
    border-radius: 50px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle-thumb {
    left: calc(100% - 23px);
}

/* Icônes dans le thumb */
.theme-toggle-thumb svg {
    width: 12px;
    height: 12px;
    color: var(--primary-foreground);
    transition: all 0.3s ease;
}

.theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

.theme-toggle .icon-sun {
    display: block;
}

/* Étoiles et nuages dans le track */
.theme-toggle-track::before,
.theme-toggle-track::after {
    content: '';
    position: absolute;
    transition: all 0.5s ease;
}

/* Étoiles (mode sombre) */
.theme-toggle-track::before {
    top: 5px;
    right: 8px;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow:
        8px 4px 0 0 white,
        4px 10px 0 -1px white,
        12px 8px 0 -1px white;
    opacity: 1;
}

[data-theme="light"] .theme-toggle-track::before {
    opacity: 0;
    transform: translateX(-20px);
}

/* Nuage (mode clair) */
.theme-toggle-track::after {
    top: 8px;
    left: 6px;
    width: 12px;
    height: 6px;
    background: white;
    border-radius: 10px;
    box-shadow:
        4px -2px 0 0 white,
        8px 0 0 0 white;
    opacity: 0;
    transform: translateX(20px);
}

[data-theme="light"] .theme-toggle-track::after {
    opacity: 1;
    transform: translateX(0);
}

[data-theme="light"] .theme-toggle-track {
    background: hsl(200, 80%, 70%);
}

/* Label du toggle */
.theme-toggle-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: none;
}

@media (min-width: 1024px) {
    .theme-toggle-label {
        display: block;
    }
}

/* ============================================
   ANIMATION DE TRANSITION DE THÈME
   ============================================ */

.theme-transitioning * {
    transition:
        background-color 0.5s ease,
        border-color 0.5s ease,
        color 0.3s ease,
        box-shadow 0.5s ease !important;
}

/* ============================================
   TOGGLE MOBILE
   ============================================ */

.mobile-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 1rem 0;
}

.mobile-theme-toggle span {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .theme-toggle {
        padding: 4px;
    }

    .theme-toggle-track {
        width: 44px;
        height: 24px;
    }

    .theme-toggle-thumb {
        width: 18px;
        height: 18px;
    }

    [data-theme="light"] .theme-toggle-thumb {
        left: calc(100% - 21px);
    }

    .theme-toggle-thumb svg {
        width: 10px;
        height: 10px;
    }
}
