/* Glass Compass Navigation System */
:root {
    --compass-glass-bg: rgba(255, 255, 255, 0.75);
    --compass-glass-border: rgba(255, 255, 255, 0.4);
    --compass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --compass-blur: blur(12px);
    --compass-accent: #0f172a;
    /* Slate 900 */
    --compass-text: #334155;
    --compass-active: #e11d48;
    /* Rose 600 */
}

/* =========================================
   DESKTOP: RIGHT RAIL SIDEBAR
   ========================================= */
.compass-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 8px;
    background: var(--compass-glass-bg);
    backdrop-filter: var(--compass-blur);
    -webkit-backdrop-filter: var(--compass-blur);
    border-radius: 32px;
    border: 1px solid var(--compass-glass-border);
    box-shadow: var(--compass-shadow);
    transition: all 0.3s ease;
}

.compass-link {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover & Active States */
.compass-link:hover {
    background: var(--compass-accent);
    transform: scale(1.2);
}

.compass-link.active {
    background: var(--compass-active);
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.2);
}

/* Tooltip Labels (Slide out on hover) */
.compass-label {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.compass-label::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(15, 23, 42, 0.9);
}

.compass-link:hover .compass-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* =========================================
   MOBILE: FLOATING ACTION BUTTON (FAB)
   ========================================= */
.mobile-compass-wrapper {
    display: none;
    /* Hidden on desktop */
}

/* Mobile Breakpoint */
@media (max-width: 1024px) {
    .compass-nav {
        display: none;
        /* Hide desktop rails */
    }

    .mobile-compass-wrapper {
        display: block;
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 1000;
    }

    /* The FAB Button */
    .compass-fab {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--compass-active);
        color: white;
        border: none;
        box-shadow: 0 8px 24px rgba(225, 29, 72, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        position: relative;
        z-index: 1002;
    }

    .compass-fab:active {
        transform: scale(0.9);
    }

    .compass-fab.open {
        transform: rotate(45deg);
        background: #334155;
    }

    /* The Blooming Menu */
    .compass-menu {
        position: absolute;
        bottom: 70px;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: flex-end;
        pointer-events: none;
        z-index: 1002;
        /* Pass through clicks when closed */
    }

    .mobile-link-item {
        display: flex;
        align-items: center;
        gap: 12px;
        opacity: 0;
        transform: translateY(20px) scale(0.8);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }

    /* Staggered Animation Delay for Bloom Effect */
    .mobile-link-item:nth-child(6) {
        transition-delay: 0.05s;
    }

    .mobile-link-item:nth-child(5) {
        transition-delay: 0.1s;
    }

    .mobile-link-item:nth-child(4) {
        transition-delay: 0.15s;
    }

    .mobile-link-item:nth-child(3) {
        transition-delay: 0.2s;
    }

    .mobile-link-item:nth-child(2) {
        transition-delay: 0.25s;
    }

    .mobile-link-item:nth-child(1) {
        transition-delay: 0.3s;
    }

    /* Open State */
    .mobile-compass-wrapper.is-open .compass-menu {
        pointer-events: auto;
    }

    .mobile-compass-wrapper.is-open .mobile-link-item {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .mobile-link-label {
        background: white;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 600;
        color: #1e293b;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        white-space: nowrap;
    }

    .mobile-link-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #1e293b;
        font-size: 18px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: background 0.2s;
    }

    .mobile-link-item:active .mobile-link-icon {
        background: #f1f5f9;
    }

    /* Backdrop for closing when clicking outside */
    .compass-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(2px);
        z-index: 1001;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .mobile-compass-wrapper.is-open .compass-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}