/**
 * Theme Switcher Widget Styles
 *
 * Floating widget that allows users to preview different website themes.
 * Accessible, responsive, and visually appealing.
 */

/* ========================================
   Theme Switcher Container
   ======================================== */

.theme-switcher-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: 'Inter', Arial, sans-serif;
}

/* ========================================
   Theme Toggle Button
   ======================================== */

.theme-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    font-size: 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.theme-btn:active {
    transform: scale(0.95);
}

.theme-btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ========================================
   Theme Menu (Dropdown)
   ======================================== */

.theme-menu {
    position: absolute;
    bottom: 75px;
    left: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: bottom left;
}

.theme-menu.hidden {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
}

/* Menu scrollbar styling */
.theme-menu::-webkit-scrollbar {
    width: 6px;
}

.theme-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.theme-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.theme-menu::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ========================================
   Menu Header
   ======================================== */

.theme-menu h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    letter-spacing: -0.3px;
}

.theme-menu-subtitle {
    margin: 0 0 20px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* ========================================
   Theme Options (Buttons)
   ======================================== */

.theme-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
}

.theme-option:last-of-type {
    margin-bottom: 0;
}

.theme-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(2px);
}

.theme-option:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: -2px;
    border-color: #667eea;
    background: #f8f9ff;
}

.theme-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    font-weight: 500;
}

.theme-option.active::after {
    content: '✓';
    float: right;
    color: #667eea;
    font-weight: bold;
}

.theme-option.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================
   Theme Option Content
   ======================================== */

.theme-option strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.theme-option .theme-desc {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* ========================================
   Info Link at Bottom
   ======================================== */

.theme-info-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    padding: 10px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    border-top: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.theme-info-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.theme-info-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .theme-switcher-widget {
        bottom: 15px;
        left: 15px;
    }

    .theme-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }

    .theme-menu {
        bottom: 70px;
        width: 280px;
        max-height: 500px;
    }

    .theme-menu h3 {
        font-size: 16px;
    }

    .theme-option {
        padding: 10px 12px;
        margin-bottom: 8px;
        font-size: 13px;
    }

    .theme-option strong {
        font-size: 13px;
        margin-bottom: 3px;
    }

    .theme-option .theme-desc {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .theme-switcher-widget {
        bottom: 10px;
        left: 10px;
    }

    .theme-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .theme-menu {
        bottom: 65px;
        left: -10px;
        width: calc(100vw - 30px);
        max-width: 320px;
        margin-left: 10px;
    }

    .theme-menu h3 {
        font-size: 15px;
    }

    .theme-option {
        padding: 10px 12px;
        margin-bottom: 8px;
    }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .theme-menu {
        background: #2a2a2a;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .theme-menu h3 {
        color: #fff;
    }

    .theme-menu-subtitle {
        color: #aaa;
    }

    .theme-option {
        background: #3a3a3a;
        border-color: #555;
        color: #f0f0f0;
    }

    .theme-option:hover {
        border-color: #667eea;
        background: #4a4a4a;
    }

    .theme-option.active {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    }

    .theme-option strong {
        color: #f0f0f0;
    }

    .theme-option .theme-desc {
        color: #aaa;
    }

    .theme-info-link {
        border-top-color: #555;
    }
}

/* ========================================
   Accessibility
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .theme-switcher-widget,
    .theme-btn,
    .theme-menu,
    .theme-option,
    .theme-info-link {
        transition: none;
    }
}

@media (max-height: 600px) {
    .theme-menu {
        max-height: 70vh;
    }
}
