/**
 * Hash Router - Section Navigation Styles
 */

/* Section Nav Container (sticky bottom on mobile, sidebar on desktop) */
.section-nav {
    display: none; /* Hidden by default, shown via JS if needed */
    position: fixed;
    z-index: 100;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile: Bottom bar */
@media (max-width: 768px) {
    .section-nav {
        display: flex;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.5rem;
        justify-content: space-around;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .section-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem 0.75rem;
        color: var(--text-secondary, #8b949e);
        text-decoration: none;
        font-size: 0.7rem;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .section-nav-item i {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .section-nav-item.active,
    .section-nav-item:hover {
        color: var(--text-primary, #fff);
        background: rgba(102, 126, 234, 0.2);
    }

    .section-nav-item.active {
        color: #667eea;
    }

    /* Add padding to body so content isn't hidden behind nav */
    body.has-section-nav {
        padding-bottom: 70px;
    }
}

/* Desktop: Floating sidebar */
@media (min-width: 769px) {
    .section-nav {
        display: flex;
        flex-direction: column;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        padding: 0.5rem;
        border-radius: 12px;
        gap: 0.25rem;
    }

    .section-nav-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
        color: var(--text-secondary, #8b949e);
        text-decoration: none;
        font-size: 0.85rem;
        border-radius: 8px;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .section-nav-item i {
        font-size: 1rem;
        width: 1.25rem;
        text-align: center;
    }

    .section-nav-item span {
        opacity: 0;
        max-width: 0;
        overflow: hidden;
        transition: all 0.2s ease;
    }

    .section-nav:hover .section-nav-item span {
        opacity: 1;
        max-width: 100px;
        margin-left: 0.5rem;
    }

    .section-nav-item.active,
    .section-nav-item:hover {
        color: var(--text-primary, #fff);
        background: rgba(102, 126, 234, 0.2);
    }

    .section-nav-item.active {
        color: #667eea;
    }

    .section-nav-item.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 60%;
        background: #667eea;
        border-radius: 2px;
    }
}

/* Share link button (appears on section headers) */
.section-share-link {
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 0.25rem 0.5rem;
    color: var(--text-muted, #6e7681);
    cursor: pointer;
    border-radius: 4px;
}

.section-header:hover .section-share-link,
.section-toggle:hover .section-share-link {
    opacity: 1;
}

.section-share-link:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.1);
}

/* Toast notification for copied link */
.hash-router-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.95);
    color: var(--text-primary, #fff);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hash-router-toast.show {
    opacity: 1;
}

/* Highlight effect when scrolling to section */
@keyframes section-highlight {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.section-highlighted {
    animation: section-highlight 1s ease-out;
}
