/**
 * Theme Toggle Modal Styles
 * Provides a floating theme selector in the top-right corner
 */

/* Theme Toggle Modal Container */
.theme-toggle-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Theme Icons */
.theme-icon {
    color: #666;
    transition: all 0.3s ease;
    position: absolute;
    opacity: 0;
    transform: scale(0.8);
}

.theme-icon.active {
    opacity: 1;
    transform: scale(1);
}

/* Theme Options Panel */
.theme-options-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 150px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 1001;
}

.theme-options-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Theme Option Items */
.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.theme-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-option.active {
    background: rgba(74, 153, 247, 0.1);
    color: #4899F7;
}

.theme-option .theme-icon {
    position: static;
    opacity: 1;
    transform: none;
    color: currentColor;
}

/* Dark Theme Styles */
:root.theme-dark .theme-toggle-btn {
    background: rgba(18, 18, 18, 0.9);
    color: #fff;
}

:root.theme-dark .theme-toggle-btn:hover {
    background: rgba(18, 18, 18, 1);
}

:root.theme-dark .theme-icon {
    color: #ccc;
}

:root.theme-dark .theme-options-panel {
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

:root.theme-dark .theme-option {
    color: #ccc;
}

:root.theme-dark .theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

:root.theme-dark .theme-option.active {
    background: rgba(74, 153, 247, 0.2);
    color: #4899F7;
}

/* Auto Theme Support */
:root.theme-auto .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
}

:root.theme-auto .theme-options-panel {
    background: rgba(255, 255, 255, 0.95);
}

/* Auto theme dark mode */
@media (prefers-color-scheme: dark) {
    :root.theme-auto .theme-toggle-btn {
        background: rgba(18, 18, 18, 0.9);
    }

    :root.theme-auto .theme-toggle-btn:hover {
        background: rgba(18, 18, 18, 1);
    }

    :root.theme-auto .theme-icon {
        color: #ccc;
    }

    :root.theme-auto .theme-options-panel {
        background: rgba(18, 18, 18, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    :root.theme-auto .theme-option {
        color: #ccc;
    }

    :root.theme-auto .theme-option:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    :root.theme-auto .theme-option.active {
        background: rgba(74, 153, 247, 0.2);
        color: #4899F7;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .theme-toggle-modal {
        top: 15px;
        right: 15px;
    }

    .theme-toggle-btn {
        width: 44px;
        height: 44px;
    }

    .theme-options-panel {
        min-width: 130px;
    }

    .theme-option {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .theme-toggle-btn,
    .theme-icon,
    .theme-options-panel,
    .theme-option {
        transition: none;
    }
}

/* Focus styles for accessibility */
.theme-toggle-btn:focus-visible {
    outline: 2px solid #4899F7;
    outline-offset: 2px;
}

.theme-option:focus-visible {
    outline: 2px solid #4899F7;
    outline-offset: -2px;
}