/* Theme Switcher Floating Button */
.theme-switcher {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--switcher-bg);
    padding: 12px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.theme-switcher-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: var(--btn-bg);
    color: var(--btn-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    position: relative;
    overflow: hidden;
}

.theme-switcher-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--btn-hover-bg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-switcher-btn:hover::before {
    opacity: 1;
}

.theme-switcher-btn i {
    position: relative;
    z-index: 1;
}

.theme-switcher-btn:hover {
    transform: scale(1.1);
    border-color: var(--btn-border);
}

.theme-switcher-btn.active {
    border-color: var(--btn-border-active);
    background: var(--btn-bg-active);
    box-shadow: 0 0 15px var(--btn-glow);
}

/* Theme button specific colors */
.theme-btn-light {
    --btn-bg: #fff;
    --btn-color: #f59e0b;
    --btn-hover-bg: #fef3c7;
    --btn-border: #fbbf24;
    --btn-border-active: #f59e0b;
    --btn-bg-active: #fef3c7;
    --btn-glow: rgba(245, 158, 11, 0.3);
}

.theme-btn-medium {
    --btn-bg: #475569;
    --btn-color: #94a3b8;
    --btn-hover-bg: #334155;
    --btn-border: #64748b;
    --btn-border-active: #94a3b8;
    --btn-bg-active: #334155;
    --btn-glow: rgba(148, 163, 184, 0.3);
}

.theme-btn-dark {
    --btn-bg: #1e293b;
    --btn-color: #60a5fa;
    --btn-hover-bg: #0f172a;
    --btn-border: #3b82f6;
    --btn-border-active: #60a5fa;
    --btn-bg-active: #0f172a;
    --btn-glow: rgba(96, 165, 250, 0.3);
}

/* Tooltip on hover */
.theme-switcher-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    background: var(--tooltip-bg);
    color: var(--tooltip-color);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.theme-switcher-btn:hover::after {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .theme-switcher {
        right: 10px;
        padding: 8px;
        gap: 8px;
        border-radius: 40px;
    }

    .theme-switcher-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .theme-switcher-btn::after {
        display: none; /* Hide tooltips on mobile */
    }
}

/* Switcher container background based on current theme */
body[data-theme="light"] .theme-switcher {
    --switcher-bg: #ffffff;
}

body[data-theme="medium-dark"] .theme-switcher {
    --switcher-bg: #334155;
}

body[data-theme="dark"] .theme-switcher {
    --switcher-bg: #1e293b;
}

/* Tooltip colors based on theme */
body[data-theme="light"] .theme-switcher-btn {
    --tooltip-bg: #1f2937;
    --tooltip-color: #f3f4f6;
}

body[data-theme="medium-dark"] .theme-switcher-btn {
    --tooltip-bg: #0f172a;
    --tooltip-color: #e2e8f0;
}

body[data-theme="dark"] .theme-switcher-btn {
    --tooltip-bg: #0f172a;
    --tooltip-color: #f1f5f9;
}

/* Animation for theme switch */
@keyframes themeSwitch {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.theme-switcher-btn.switching {
    animation: themeSwitch 0.3s ease;
}
