/* ===============================================
   Theme Switcher Component CSS
   Clean, modern theme switching interface
   =============================================== */

.theme-switcher {
    position: relative;
    display: inline-block;
    margin-right: var(--spacing-md);
}

.theme-switcher-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 120px;
    justify-content: space-between;
}

.theme-switcher-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.theme-switcher-btn:active {
    transform: translateY(1px);
}

.theme-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    /* Allow the dropdown to extend beyond the width of the trigger */
    min-width: 180px;
    margin-top: var(--spacing-xs);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    /* Make sure the dropdown is rendered above the header / modal layers */
    z-index: 2001;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

.theme-dropdown.hidden {
    display: none;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    /* Prevent long theme names from wrapping and being cut off */
    white-space: nowrap;
}

.theme-option:last-child {
    border-bottom: none;
}

.theme-option:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-option:active {
    background-color: var(--bg-accent);
}

.theme-option span {
    flex: 1;
    text-align: left;
}

.theme-check {
    color: var(--accent-primary);
    font-size: var(--font-size-xs);
    margin-left: auto;
}

/* Icon colors for different themes */
.theme-option[data-theme="default"] i:first-child {
    color: var(--accent-primary);
}

.theme-option[data-theme="scifi"] i:first-child {
    color: #00d9ff;
}

.theme-option[data-theme="fantasy"] i:first-child {
    color: #daa520;
}

.theme-option[data-theme="jarvis"] i:first-child {
    color: #00ffff;
}

.theme-option[data-theme="wizard"] i:first-child {
    color: #ff6b9d;
}

/* Animations */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .theme-switcher {
        margin-right: var(--spacing-sm);
    }
    
    .theme-switcher-btn {
        min-width: 100px;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .theme-name {
        display: none; /* Hide text on mobile, show only icon */
    }
    
    .theme-switcher-btn {
        min-width: auto;
        width: 40px;
        justify-content: center;
    }
    
    .theme-dropdown {
        left: auto;
        right: 0;
        min-width: 140px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .theme-switcher-btn,
    .theme-dropdown {
        border-width: 2px;
    }
    
    .theme-option:hover {
        outline: 2px solid var(--accent-primary);
        outline-offset: -2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .theme-switcher-btn,
    .theme-option {
        transition: none;
    }
    
    .theme-dropdown {
        animation: none;
    }
}

/* Focus styles for accessibility */
.theme-switcher-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.theme-option:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

/* Special positioning for different page layouts */
.auth-header .theme-switcher {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}

.user-info .theme-switcher {
    margin-right: var(--spacing-sm);
}

/* Dark mode enhancement */
@media (prefers-color-scheme: dark) {
    .theme-dropdown {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    }
} 