/**
 * Toggle Mode Dark/Light Premium
 * Design moderne avec animations fluides et feedback visuel
 */

/* ============================================
   Toggle Button Premium
   ============================================ */
.theme-toggle-btn {
    position: relative;
    width: 70px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    overflow: visible;
}

[data-theme="dark"] .theme-toggle-btn {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* ============================================
   Toggle Slider
   ============================================ */
.theme-toggle-btn::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

[data-theme="dark"] .theme-toggle-btn::before {
    left: calc(100% - 33px);
    background: #f7fafc;
}

/* ============================================
   Icons
   ============================================ */
.theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}

.theme-icon svg {
    width: 100%;
    height: 100%;
    stroke: white;
}

.theme-icon-light {
    left: 8px;
    opacity: 1;
}

.theme-icon-dark {
    right: 8px;
    opacity: 0;
}

[data-theme="dark"] .theme-icon-light {
    opacity: 0;
    transform: translateY(-50%) rotate(-180deg);
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 1;
    transform: translateY(-50%) rotate(0deg);
}

/* ============================================
   Animation de Transition
   ============================================ */
@keyframes themeSwitch {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.theme-switching {
    animation: themeSwitch 0.4s ease-in-out;
}

/* ============================================
   Mobile Toggle
   ============================================ */
.theme-toggle-btn--mobile {
    width: 60px;
    height: 32px;
}

.theme-toggle-btn--mobile::before {
    width: 26px;
    height: 26px;
}

[data-theme="dark"] .theme-toggle-btn--mobile::before {
    left: calc(100% - 29px);
}

.theme-toggle-btn--mobile .theme-icon {
    width: 16px;
    height: 16px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .theme-toggle-btn:not(.theme-toggle-btn--mobile) {
        width: 60px;
        height: 32px;
    }

    .theme-toggle-btn:not(.theme-toggle-btn--mobile)::before {
        width: 26px;
        height: 26px;
    }

    [data-theme="dark"] .theme-toggle-btn:not(.theme-toggle-btn--mobile)::before {
        left: calc(100% - 29px);
    }
}