/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(43, 45, 49, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: visible;
}

.theme-toggle:hover {
    transform: scale(1.05);
    border-color: rgba(188, 163, 59, 0.6);
    background: rgba(188, 163, 59, 0.15);
    box-shadow: 0 6px 20px rgba(188, 163, 59, 0.3),
        0 0 30px rgba(188, 163, 59, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    bottom: -2px;
    left: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg,
            transparent 0%,
            transparent 45%,
            rgba(188, 163, 59, 0.2) 50%,
            rgba(255, 255, 255, 0.3) 52%,
            rgba(188, 163, 59, 0.2) 54%,
            transparent 60%,
            transparent 100%);
    background-size: 200% 200%;
    opacity: 0;
    pointer-events: none;
}

.theme-toggle:hover::before {
    animation: glimmer 2s ease-in-out 1;
}

@keyframes glimmer {
    0% {
        background-position: 200% 200%;
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        background-position: -200% -200%;
        opacity: 0;
    }
}

.theme-toggle svg {
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.theme-toggle:hover svg {
    color: rgba(188, 163, 59, 1);
}

.moon-icon {
    display: none;
}

[data-theme="light"] body {
    background-color: #3d3f43;
}

[data-theme="light"] #schematic-grid {
    opacity: 0.04;
}

[data-theme="light"] .theme-toggle {
    background: rgba(60, 63, 68, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(188, 163, 59, 0.15);
    border-color: rgba(188, 163, 59, 0.6);
    box-shadow: 0 6px 20px rgba(188, 163, 59, 0.3),
        0 0 30px rgba(188, 163, 59, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .theme-toggle svg {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .theme-toggle:hover svg {
    color: rgba(188, 163, 59, 1);
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

@keyframes initialGlow {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
            0 0 15px rgba(188, 163, 59, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }
}

.theme-toggle {
    animation: initialGlow 1.5s ease-in-out 1;
}