/* ==========================================================================
   GAMASUSCO SPRING TOGGLE (Light / Dark Mode Switch)
   Authentic physics & spring cord inspired by https://springtoggle.framer.website/
   ========================================================================== */

#spring-toggle-root,
#spring-toggle-root * {
    box-sizing: border-box;
}

#spring-toggle-root {
    position: fixed;
    top: 0;
    right: 26px;
    width: 60px;
    height: 360px;
    z-index: 100000;
    pointer-events: none;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
}

#spring-toggle-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.spring-cord-path {
    stroke: #ffffff;
    stroke-width: 2.5px;
    stroke-linecap: round;
    fill: none;
    transition: stroke 0.4s ease;
}

[data-theme="light"] .spring-cord-path {
    stroke: #000000;
}

/* Ceiling anchor mount */
.spring-mount {
    position: absolute;
    top: 0;
    left: 30px;
    transform: translateX(-50%);
    width: 16px;
    height: 5px;
    background: #ffffff;
    border-radius: 0 0 3px 3px;
    transition: background-color 0.4s ease;
}

[data-theme="light"] .spring-mount {
    background: #000000;
}

/* Hanging Switch Pendant (Compact cord length resting at 32px, unobtrusive) */
.spring-pendant {
    position: absolute;
    top: 0;
    left: 30px;
    width: 44px;
    height: 44px;
    margin-left: -22px;
    margin-top: 32px;
    border-radius: 12px;
    background-color: #0a0e12;
    border: 2px solid #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    will-change: transform;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.spring-pendant:active {
    cursor: grabbing;
}

/* Visual feedback when pulled past latch threshold */
.spring-pendant.is-pulled {
    border-color: #00d68f;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 214, 143, 0.45);
}

/* In Light mode: solid black square pendant with white icon on white background */
[data-theme="light"] .spring-pendant {
    background-color: #000000;
    border-color: #000000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .spring-pendant.is-pulled {
    border-color: #00a86b;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25), 0 0 16px rgba(0, 168, 107, 0.45);
}

/* Pendant Icons Container */
.spring-icon-box {
    position: relative;
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.spring-icon {
    position: absolute;
    inset: 0;
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

/* Sun Icon (shown in light mode) */
.spring-sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.3);
}

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

/* Moon Icon (shown in dark mode) */
.spring-moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
    #spring-toggle-root {
        right: 24px;
    }
}

@media (max-width: 480px) {
    #spring-toggle-root {
        right: 20px;
    }
}
