/* Theme Switcher Component - Dual Theme Toggle Button */

/* ============================================
   THEME STYLE TOGGLE BUTTON
   ============================================ */

.theme-style-toggle {
    background: var(--white);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 16px;  /* Reduced from 20px */
    padding: 0.2rem;  /* Reduced from 0.25rem */
    display: flex;
    gap: 0.2rem;  /* Reduced from 0.25rem */
    transition: var(--transition);
    margin-right: 20px;  /* Position unchanged */
}

.theme-option {
    padding: 0.3rem 0.5rem;  /* Reduced padding to make room for larger icons */
    border-radius: 13px;  /* Reduced from 16px */
    font-size: 0.7rem;  /* Slightly smaller */
    font-weight: 600;
    transition: var(--transition);
    border: none;
    background: transparent;
    cursor: pointer;
    letter-spacing: 0.05em;
    text-transform: none;  /* Changed from uppercase to show "Jazzy" and "Calm" */
    color: var(--text-color);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;  /* Reduced gap to maximize icon size */
}

/* Theme icon images */
.theme-icon-img {
    width: 36px;  /* Optimized size for reduced container */
    height: 36px; /* Optimized size for reduced container */
    object-fit: contain;
    border-radius: 50%;
    transition: var(--transition);
}

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

.theme-option.active {
    background: var(--primary-color);
    color: var(--white);
}

/* Theme-specific active button colors */
[data-theme-style="jazzy"] .theme-option.active {
    background: #2563eb;
    color: white;
}

[data-theme-style="calm"] .theme-option.active {
    background: #111111;
    color: white;
}

/* Dark mode adjustments */
[data-theme="dark"] .theme-style-toggle {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .theme-option {
    color: #d1d5db;
}

[data-theme="dark"] .theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-option.active {
    color: white;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .theme-style-toggle {
        padding: 0.15rem;  /* Reduced from 0.2rem */
        gap: 0.15rem;  /* Reduced from 0.2rem */
        border-radius: 14px;  /* Reduced proportionally */
    }

    .theme-option {
        padding: 0.25rem 0.45rem;  /* Reduced padding for smaller mobile size */
        font-size: 0.65rem;  /* Slightly smaller */
        gap: 0.3rem;  /* Reduced gap */
        border-radius: 11px;  /* Reduced proportionally */
    }

    .theme-icon-img {
        width: 32px;  /* Optimized for mobile - reduced proportionally */
        height: 32px; /* Optimized for mobile - reduced proportionally */
    }
}

/* Tooltip for theme switcher (optional) */
.theme-style-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-color);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    pointer-events: none;
}

.theme-style-toggle:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Focus states for accessibility */
.theme-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.theme-option:focus:not(:focus-visible) {
    outline: none;
}

/* Animation for theme switch */
.theme-option.active {
    animation: themeActivate 0.3s ease;
}

@keyframes themeActivate {
    0% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading state */
.theme-style-toggle.loading .theme-option {
    opacity: 0.6;
    cursor: wait;
}

/* Disabled state */
.theme-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.theme-option:disabled:hover {
    background: transparent;
}
