/**
 * Theme Switcher Component
 * A minimal toggle for light/dark theme switching
 */

.theme-switcher {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.theme-switcher__toggle {
    position: relative;
    width: 48px;
    height: 24px;
    background: rgba(113, 113, 122, 0.2);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 0;
}

.theme-switcher__toggle:hover {
    background: rgba(113, 113, 122, 0.3);
}

[data-theme="dark"] .theme-switcher__toggle {
    background: rgba(161, 161, 170, 0.2);
}

[data-theme="dark"] .theme-switcher__toggle:hover {
    background: rgba(161, 161, 170, 0.3);
}

.theme-switcher__slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-switcher__slider {
    transform: translateX(24px);
    background: #1f2937;
}

.theme-switcher__icon {
    display: inline-block;
    transition: opacity 0.3s ease;
}

/* Sun icon - visible in light mode */
.theme-switcher__icon--sun {
    opacity: 1;
}

[data-theme="dark"] .theme-switcher__icon--sun {
    opacity: 0;
}

/* Moon icon - visible in dark mode */
.theme-switcher__icon--moon {
    opacity: 0;
    position: absolute;
}

[data-theme="dark"] .theme-switcher__icon--moon {
    opacity: 1;
}

/* Responsive - hide on mobile */
@media (max-width: 768px) {
    .theme-switcher {
        margin-left: 0.5rem;
    }

    .theme-switcher__toggle {
        width: 42px;
        height: 22px;
    }

    .theme-switcher__slider {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    [data-theme="dark"] .theme-switcher__slider {
        transform: translateX(20px);
    }
}

/* Accessibility */
.theme-switcher__toggle:focus {
    outline: 2px solid #b91c1c;
    outline-offset: 2px;
}

[data-theme="dark"] .theme-switcher__toggle:focus {
    outline-color: #dc2626;
}

.theme-switcher__toggle:focus:not(:focus-visible) {
    outline: none;
}
