/* Theme Toggle Button Styles */
.theme-toggle-btn {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: inherit;
    cursor: pointer;
    visibility: visible !important;
    opacity: 1 !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus,
.theme-toggle-btn:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Icons */
.theme-toggle-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
}

/* Light mode - show sun, hide moon */
.theme-toggle-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* Dark mode - show moon, hide sun */
[data-theme="dark"] .theme-toggle-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-toggle-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Animation keyframes */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.theme-toggle-btn:active .theme-toggle-sun,
.theme-toggle-btn:active .theme-toggle-moon {
    animation: spin 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        z-index: 9999 !important;
        pointer-events: auto !important;
    }

    .theme-toggle-icon svg {
        width: 24px;
        height: 24px;
    }
}
