/**
 * KVS Theme Switcher Styles
 * Styles for the light/dark theme toggle button
 */

/* Theme Switcher Button */
.theme-switcher {
    position: relative;
}

.theme-switcher a {
    display: inline-block;
    padding: 4px 8px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.theme-switcher a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.theme-switcher a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Theme Icons */
.theme-icon {
    font-size: 16px;
    display: inline-block;
    transition: all 0.3s ease;
}

.theme-icon.light-icon {
    display: none; /* Initially hidden, shown when in dark theme */
}

.theme-icon.dark-icon {
    display: inline; /* Initially shown, hidden when in dark theme */
}

/* White Theme Specific Styles */
body.theme-white .theme-switcher a {
    color: #333;
}

body.theme-white .theme-switcher a:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

/* Metal Theme Specific Styles */
body.theme-metal .theme-switcher a {
    color: #ccc;
}

body.theme-metal .theme-switcher a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Animation for theme switching */
@keyframes themeSwitch {
    0% { opacity: 0; transform: rotate(0deg) scale(0.8); }
    50% { opacity: 0.5; transform: rotate(180deg) scale(1.1); }
    100% { opacity: 1; transform: rotate(360deg) scale(1); }
}

.theme-switcher a.switching .theme-icon {
    animation: themeSwitch 0.6s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-switcher {
        margin-left: 10px;
    }
    
    .theme-icon {
        font-size: 18px;
    }
}

/* Accessibility improvements */
.theme-switcher a[aria-pressed="true"] {
    background-color: rgba(0, 123, 186, 0.2);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .theme-switcher a {
        border: 2px solid currentColor;
    }
    
    .theme-switcher a:hover {
        background-color: currentColor;
        color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .theme-switcher a,
    .theme-icon {
        transition: none;
    }
    
    .theme-switcher a.switching .theme-icon {
        animation: none;
    }
}

/* Tooltip for better UX */
.theme-switcher a::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.theme-switcher a:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Integration with existing KVS styles */
.top-links .member-links .theme-switcher {
    display: inline-block;
}

.top-links .member-links ul li.theme-switcher {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 10px;
    margin-left: 10px;
}

/* Dark theme adjustments for tooltip */
body.theme-metal .theme-switcher a::after {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}