﻿/* ================================
   NETWORK NAVIGATION SYSTEM
   MSP-grade persistent header nav
   ================================ */

/* ─── Header ──────────────────────────────────────────────────────────────── */

.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 111, 60, 0.1);
    z-index: 9997;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

    .nav-header.scrolled {
        border-bottom-color: rgba(255, 111, 60, 0.35);
        box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
    }

/* ─── Brand ───────────────────────────────────────────────────────────────── */

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-family: var(--font-personality);
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

    .nav-brand img {
        height: 36px;
        width: auto;
        flex-shrink: 0;
    }

/* ─── Desktop Nav ─────────────────────────────────────────────────────────── */

.nn-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    margin-right: 0;
}

.nn-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0.4rem 0.85rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
    outline: none;
}

    .nn-link:hover {
        background: rgba(255, 111, 60, 0.06);
    }

    .nn-link:focus-visible {
        outline: 2px solid var(--primary-orange);
        outline-offset: 2px;
    }

/* ─── Node Dot ────────────────────────────────────────────────────────────── */

.nn-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
    z-index: 1;
}

    .nn-dot.active {
        background: var(--primary-orange);
        box-shadow: 0 0 8px rgba(255, 111, 60, 0.8);
        animation: nn-dot-pulse 2.5s ease-in-out infinite;
    }

.nn-link:hover .nn-dot {
    background: var(--primary-orange);
    box-shadow: 0 0 6px rgba(255, 111, 60, 0.6);
    transform: scale(1.3);
}

@keyframes nn-dot-pulse {
    0%, 100% {
        box-shadow: 0 0 6px rgba(255, 111, 60, 0.7);
    }

    50% {
        box-shadow: 0 0 14px rgba(255, 111, 60, 1);
    }
}

/* ─── Ping Ripple ─────────────────────────────────────────────────────────── */

.nn-ping {
    position: absolute;
    top: 0.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--primary-orange);
    opacity: 0;
    pointer-events: none;
}

.nn-link:hover .nn-ping,
.nn-link.active .nn-ping {
    animation: nn-ping 1.6s ease-out infinite;
}

@keyframes nn-ping {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translateX(-50%) scale(3.5);
        opacity: 0;
    }
}

/* ─── Nav Label ───────────────────────────────────────────────────────────── */

.nn-label {
    font-family: var(--font-utility);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nn-link:hover .nn-label {
    color: var(--text-primary);
}

.nn-link.active .nn-label {
    color: var(--primary-orange);
    font-weight: 600;
}

/* ─── Signal Canvas ───────────────────────────────────────────────────────── */

.nn-signal-canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    pointer-events: none;
    display: block;
}

/* ─── Mobile Hamburger ────────────────────────────────────────────────────── */

.nn-burger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 111, 60, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

    .nn-burger:hover {
        border-color: var(--primary-orange);
        background: rgba(255, 111, 60, 0.08);
    }

    .nn-burger span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text-secondary);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease, background 0.2s ease;
    }

    .nn-burger:hover span {
        background: var(--primary-orange);
    }

    .nn-burger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nn-burger.active span:nth-child(2) {
        opacity: 0;
    }

    .nn-burger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

/* ─── Mobile Drawer ───────────────────────────────────────────────────────── */

.nn-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 111, 60, 0.2);
    z-index: 9996;
    padding: 1rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Hidden state */
    clip-path: inset(0 0 100% 0);
    pointer-events: none;
    transition: clip-path 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

    .nn-drawer.open {
        clip-path: inset(0 0 0% 0);
        pointer-events: all;
    }

/* ─── Drawer Links ────────────────────────────────────────────────────────── */

.nn-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.75rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    font-family: var(--font-utility);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    /* Staggered slide-in — delay set inline via JS */
    opacity: 0;
    transform: translateX(-10px);
}

.nn-drawer.open .nn-drawer-link {
    animation: nn-drawer-slide 0.3s ease forwards;
}

@keyframes nn-drawer-slide {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nn-drawer-link:hover {
    color: var(--text-primary);
    background: rgba(255, 111, 60, 0.06);
    border-left-color: rgba(255, 111, 60, 0.4);
}

.nn-drawer-link.active {
    color: var(--primary-orange);
    border-left-color: var(--primary-orange);
    background: rgba(255, 111, 60, 0.08);
    font-weight: 600;
}

.nn-drawer-link .nn-dot {
    flex-shrink: 0;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .nn-nav {
        display: none;
    }

    .nn-burger {
        display: flex;
    }
}

@media (max-width: 480px) {
    .nav-header {
        padding: 0 1.25rem;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

        .nav-brand img {
            height: 30px;
        }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .nn-dot,
    .nn-ping,
    .nn-drawer-link,
    .nn-burger span,
    .nn-link,
    .nn-drawer {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .nn-drawer {
        clip-path: none !important;
        display: none;
    }

        .nn-drawer.open {
            display: flex;
        }

    .nn-drawer-link {
        opacity: 1;
        transform: none;
    }
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

.nav-footer {
    background: var(--card-bg);
    border-top: 1px solid rgba(255, 111, 60, 0.15);
    padding: 3rem 0 2rem;
    margin-top: 5rem;
    position: relative;
}

    .nav-footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient( 90deg, transparent 0%, rgba(255, 111, 60, 0.5) 30%, rgba(255, 111, 60, 0.8) 50%, rgba(255, 111, 60, 0.5) 70%, transparent 100% );
    }

.footer-nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-bottom: 2.5rem;
}

.footer-nav-link {
    font-family: var(--font-utility);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background 0.2s ease;
    letter-spacing: 0.02em;
}

    .footer-nav-link:hover {
        color: var(--primary-orange);
        background: rgba(255, 111, 60, 0.08);
    }

.footer-copyright {
    text-align: center;
    color: var(--text-muted);
}

    .footer-copyright p {
        font-family: var(--font-utility);
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
        color: var(--text-muted);
    }

    .footer-copyright .chip-icon {
        opacity: 0.5;
        transition: opacity 0.3s ease;
    }

        .footer-copyright .chip-icon:hover {
            opacity: 1;
        }

/* ─── No-JS Fallback ──────────────────────────────────────────────────────── */

.nn-nav-fallback {
    display: none;
}

/* ─── Legacy cleanup ──────────────────────────────────────────────────────── */
/* Remove old constellation classes if still referenced anywhere */

.constellation-nav-overlay,
.constellation-canvas,
.constellation-nodes,
.nav-toggle,
.nav-node,
.nav-node-circle,
.nav-node-label,
.stars-background,
.star {
    display: none !important;
}
