/* ═══════════════════════════════════════════════════════
   RUST RENEW — SHARED NAV + TRANSITIONS
   Unified navigation bar across all modules
   ═══════════════════════════════════════════════════════ */

/* ─── NAV BAR ────────────────────────────────────────── */
.rr-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 48px;
    background: rgba(3, 3, 3, 0.92);
    border-bottom: 1px solid #2a2a2a;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: 'Share Tech Mono', monospace;
}

/* Hub logo */
.rr-nav-home {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #e5e5e5;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.rr-nav-home:hover { color: #fff; }
.rr-nav-home i {
    font-size: 10px;
    color: #737373;
    transition: transform 0.25s, color 0.2s;
}
.rr-nav-home:hover i {
    transform: translateX(-3px);
    color: #e5e5e5;
}
.rr-nav-home .accent { color: var(--nav-accent, #ef4444); }

/* Center links — desktop */
.rr-nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.rr-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    color: #525252;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.25s, background 0.25s;
    border-radius: 3px;
    white-space: nowrap;
}
.rr-nav-link i { font-size: 9px; }
.rr-nav-link:hover {
    color: #a3a3a3;
    background: rgba(255, 255, 255, 0.03);
}
.rr-nav-link.active {
    color: var(--nav-accent, #ef4444);
    background: rgba(255, 255, 255, 0.04);
}
.rr-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 2px;
    background: var(--nav-accent, #ef4444);
    border-radius: 1px;
    box-shadow: 0 0 8px var(--nav-accent, #ef4444);
    animation: navGlow 2s ease-in-out infinite;
}

@keyframes navGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--nav-accent, #ef4444); }
    50% { opacity: 0.6; box-shadow: 0 0 4px var(--nav-accent, #ef4444); }
}

/* LED indicator — right side */
.rr-nav-led {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.rr-nav-led-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nav-accent, #ef4444);
    border: 1px solid #000;
    box-shadow: 0 0 8px var(--nav-accent, #ef4444), 0 0 16px var(--nav-accent, #ef4444);
    animation: ledPulse 2s ease-in-out infinite;
}
@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.rr-nav-led-text {
    font-size: 9px;
    color: var(--nav-accent, #ef4444);
    letter-spacing: 2px;
    opacity: 0.8;
}

/* Mobile hamburger */
.rr-nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
    cursor: pointer;
    padding: 5px;
    transition: border-color 0.2s;
}
.rr-nav-burger:hover { border-color: #525252; }
.rr-nav-burger span {
    display: block;
    height: 2px;
    background: #737373;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    transform-origin: center;
}
.rr-nav-burger.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.rr-nav-burger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.rr-nav-burger.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile menu overlay */
.rr-nav-mobile {
    display: none;
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 3, 3, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.rr-nav-mobile.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}
.rr-nav-mobile .rr-nav-link {
    font-size: 16px;
    padding: 12px 28px;
    letter-spacing: 3px;
    color: #737373;
    border: 1px solid transparent;
    transition: all 0.25s;
}
.rr-nav-mobile .rr-nav-link:hover {
    color: #e5e5e5;
    border-color: #2a2a2a;
    background: rgba(255, 255, 255, 0.04);
}
.rr-nav-mobile .rr-nav-link.active {
    color: var(--nav-accent, #ef4444);
    border-color: var(--nav-accent, #ef4444);
    background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 768px) {
    .rr-nav-links { display: none; }
    .rr-nav-burger { display: flex; }
    .rr-nav-led-text { display: none; }
}

/* ─── PAGE TRANSITION OVERLAY ────────────────────────── */
.rr-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
}

/* Scanline sweep effect */
.rr-transition::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(3, 3, 3, 0.2) 20%,
        var(--nav-accent, #ef4444) 49.5%,
        #fff 50%,
        var(--nav-accent, #ef4444) 50.5%,
        rgba(3, 3, 3, 0.2) 80%,
        transparent 100%
    );
    transition: none;
}

/* Glitch bars */
.rr-transition .glitch-bar {
    position: absolute;
    left: 0;
    width: 100%;
    background: var(--nav-accent, #ef4444);
    opacity: 0;
    mix-blend-mode: screen;
}

/* Active state — sweep animation */
.rr-transition.sweep-out {
    pointer-events: all;
    background: rgba(3, 3, 3, 0);
}
.rr-transition.sweep-out::before {
    animation: sweepDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.rr-transition.sweep-out .glitch-bar {
    animation: glitchFlash 0.5s ease-out;
}

@keyframes sweepDown {
    0% { top: -100%; }
    40% { top: 0%; }
    100% { top: 100%; }
}

@keyframes glitchFlash {
    0% { opacity: 0; transform: scaleX(1); }
    15% { opacity: 0.8; transform: scaleX(1.02); }
    30% { opacity: 0; transform: scaleX(0.98); }
    45% { opacity: 0.6; transform: scaleX(1.01); }
    60% { opacity: 0; }
    100% { opacity: 0; }
}

/* Screen blackout for final redirect */
.rr-transition.blackout {
    background: #030303;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.rr-transition.blackout.active {
    opacity: 1;
}

/* Page entry animation */
.rr-page-enter {
    animation: pageEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes pageEnter {
    0% {
        opacity: 0;
        transform: translateY(8px);
        filter: brightness(1.4) contrast(1.2);
    }
    50% {
        filter: brightness(1.1) contrast(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: brightness(1) contrast(1);
    }
}

/* CRT flicker on enter */
.rr-crt-enter::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 9998;
    pointer-events: none;
    animation: crtFade 0.6s ease-out forwards;
}
@keyframes crtFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
