/* === ULTRA-PREMIUM V12 CAPSULE THEME TOGGLE === */

.theme-toggle {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    /* Explicitly remove any inherited Quantum Aura or pulses */
    animation: none !important;
}

.theme-toggle::before,
.theme-toggle::after {
    display: none !important;
    content: none !important;
}

/* Refractive Glass Track */
.theme-toggle-track {
    position: relative;
    width: 80px;
    height: 38px;
    background: rgba(10, 18, 36, 0.45);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    /* Refractive inner shadow */
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.35),
        inset 0 -1px 2px rgba(255, 255, 255, 0.06),
        0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

/* Light refraction highlight on track */
.theme-toggle-track::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: 22px 22px 0 0;
    pointer-events: none;
}

[data-theme="light"] .theme-toggle-track {
    background: rgba(240, 245, 255, 0.75);
    border-color: rgba(100, 116, 139, 0.2);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.07),
        inset 0 -1px 2px rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Track Icons for context */
.track-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    pointer-events: none;
    z-index: 1;
}

.track-icon {
    color: rgba(255, 255, 255, 0.45);
    transition: all 0.3s ease;
}

[data-theme="light"] .track-icon {
    color: rgba(79, 70, 229, 0.45);
}

.track-icon-sun {
    opacity: 0.6;
}

.track-icon-moon {
    opacity: 0.6;
}

/* 3D Tactile Knob */
.theme-toggle-knob {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Dark Mode: Warm golden sun knob */
[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(42px);
    background: linear-gradient(135deg, #fde68a 0%, #f59e0b 60%, #d97706 100%);
    box-shadow:
        0 0 18px rgba(251, 191, 36, 0.7),
        0 0 40px rgba(245, 158, 11, 0.35),
        0 4px 10px rgba(0, 0, 0, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        inset 0 -1px 2px rgba(0, 0, 0, 0.15);
}

/* Light Mode: Cool indigo moon knob */
[data-theme="light"] .theme-toggle-knob {
    transform: translateX(0);
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 0 18px rgba(99, 102, 241, 0.4),
        0 4px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.theme-icon {
    position: absolute;
    color: white;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.25));
}

.sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

/* Premium hover effects */
.theme-toggle:hover .theme-toggle-track {
    border-color: rgba(255, 255, 255, 0.35);
    scale: 1.06;
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.35),
        0 0 16px rgba(16, 185, 129, 0.2);
}

[data-theme="light"] .theme-toggle:hover .theme-toggle-track {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.07),
        0 0 16px rgba(99, 102, 241, 0.2);
}

/* Ripple on active state */
.theme-toggle:active .theme-toggle-knob {
    scale: 0.9;
}
