* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-blue: #00D9FF;
    --dark-bg: #0a0e27;
    --darker-bg: #050811;
    --grid-color: rgba(0, 217, 255, 0.1);
    --text-primary: #E0F7FF;
    --text-secondary: #7BA7BC;
    --accent-cyan: #00FFFF;
    --warning-red: #FF0055;
    --success-green: #00FF88;
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--darker-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Scan line effect */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to bottom, 
        transparent, 
        var(--neon-blue), 
        transparent
    );
    animation: scan 4s linear infinite;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.3;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    opacity: 0.3;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

#login-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#login-screen.active {
    display: flex;
}

.login-container {
    text-align: center;
    max-width: 500px;
    width: 90%;
    padding: 3rem;
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid var(--neon-blue);
    box-shadow: 
        0 0 20px rgba(0, 217, 255, 0.3),
        inset 0 0 20px rgba(0, 217, 255, 0.1);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-blue), transparent, var(--neon-blue));
    z-index: -1;
    opacity: 0.3;
    animation: border-flow 3s linear infinite;
}

@keyframes border-flow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.logo-container {
    margin-bottom: 2rem;
}

.vibraline-logo {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 0 15px var(--neon-blue));
    animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.glitch-text {
    font-size: 3rem;
    font-weight: bold;
    color: var(--neon-blue);
    text-shadow: 
        0 0 10px var(--neon-blue),
        0 0 20px var(--neon-blue),
        0 0 30px var(--neon-blue);
    letter-spacing: 0.3rem;
    margin-bottom: 0.5rem;
    position: relative;
    animation: glitch 5s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 0.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.clearance-select {
    margin: 2rem 0;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    color: var(--neon-blue);
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
    margin-bottom: 0.5rem;
}

.terminal-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-blue);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    border-radius: 0;
    -webkit-appearance: none;
}

.terminal-input:focus {
    box-shadow: 0 0 10px var(--neon-blue);
    border-color: var(--accent-cyan);
}

.terminal-input option {
    background: var(--dark-bg);
    color: var(--text-primary);
}

.enter-button {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 0.2rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.enter-button:hover {
    background: var(--neon-blue);
    color: var(--darker-bg);
    box-shadow: 0 0 20px var(--neon-blue);
}

.enter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.enter-button:hover::before {
    left: 100%;
}

/* Login screen status (renamed to avoid conflict) */
.system-status-login {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Auth message */
.auth-message {
    padding: 0.75rem 1rem;
    border: 1px solid;
    font-size: 0.75rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    letter-spacing: 0.02rem;
}

/* Login divider (OR) */
.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.login-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(0, 217, 255, 0.2);
}

.login-divider-text {
    color: var(--text-secondary);
    font-size: 0.7rem;
    letter-spacing: 0.15rem;
}

/* Guest button */
.guest-button {
    width: 100%;
    padding: 0.85rem;
    background: transparent;
    border: 1px solid rgba(123, 167, 188, 0.4);
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.15rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.guest-button:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background: rgba(123, 167, 188, 0.1);
}

.guest-note {
    margin-top: 0.75rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.6;
    line-height: 1.5;
    text-align: center;
}

/* Disabled verify button */
.enter-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Subscribe link on landing */
.subscribe-link {
    display: block;
    margin-top: 1.25rem;
    color: var(--neon-blue);
    font-size: 0.7rem;
    text-align: center;
    letter-spacing: 0.03rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.subscribe-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-green);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   MAIN HUB
   ============================================ */

#main-hub {
    display: none;
    min-height: 100vh;
    padding-bottom: 5rem;
}

#main-hub.active {
    display: block;
}

/* Header */
.hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(10, 14, 39, 0.95);
    border-bottom: 2px solid var(--neon-blue);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.logo-small {
    width: 36px;
    height: auto;
    filter: drop-shadow(0 0 8px var(--neon-blue));
    flex-shrink: 0;
}

.header-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--neon-blue);
    letter-spacing: 0.1rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.08rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.clearance-badge {
    padding: 0.4rem 0.75rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
}

.clearance-badge.vibraline-tier {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--success-green);
    color: var(--success-green);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.logout-btn {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    border-color: var(--warning-red);
    color: var(--warning-red);
}

/* ============================================
   HAMBURGER MENU
   ============================================ */

.hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    transition: border-color 0.3s ease;
}

.hamburger:hover {
    border-color: var(--neon-blue);
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--neon-blue);
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger open state */
.hamburger.open .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.open .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Navigation — desktop: horizontal bar */
.main-nav {
    display: flex;
    gap: 0;
    background: rgba(5, 8, 17, 0.9);
    border-bottom: 1px solid var(--neon-blue);
    overflow-x: auto;
    position: sticky;
    top: 58px; /* Matches header height */
    z-index: 99;
}

.nav-link {
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.08rem;
    border-right: 1px solid rgba(0, 217, 255, 0.15);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(0, 217, 255, 0.1);
    color: var(--neon-blue);
}

.nav-link.active {
    background: rgba(0, 217, 255, 0.15);
    color: var(--neon-blue);
    border-bottom: 2px solid var(--neon-blue);
}

/* Nav overlay (mobile backdrop) */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 98;
}

.nav-overlay.active {
    display: block;
}

/* Main Content */
.hub-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: 0.15rem;
    font-weight: normal;
}

.title-bracket {
    color: var(--neon-blue);
    font-weight: bold;
}

/* ============================================
   SYSTEM STATUS
   ============================================ */

.system-status-section {
    margin-bottom: 2.5rem;
}

.status-container {
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid var(--neon-blue);
    padding: 1.25rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.status-pulse {
    width: 10px;
    height: 10px;
    background: var(--success-green);
    border-radius: 50%;
    animation: pulse-status 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--success-green);
    flex-shrink: 0;
}

@keyframes pulse-status {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.status-label {
    color: var(--neon-blue);
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    font-weight: bold;
}

.status-message {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    border-left: 2px solid var(--neon-blue);
}

.status-meta {
    display: flex;
    justify-content: flex-end;
}

.status-timestamp {
    color: var(--text-secondary);
    font-size: 0.65rem;
    letter-spacing: 0.05rem;
}

/* ============================================
   LAST FILES ADDED
   ============================================ */

.last-files-added {
    margin-bottom: 2.5rem;
}

.files-grid {
    display: grid;
    gap: 0.75rem;
}

.file-card {
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-left: 3px solid var(--neon-blue);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

a.file-card:hover {
    background: rgba(0, 217, 255, 0.08);
    border-color: var(--neon-blue);
    transform: translateX(4px);
}

/* Non-clickable system/network entries */
.file-card--system {
    border-left-color: var(--text-secondary);
    opacity: 0.7;
    cursor: default;
}

.file-date {
    color: var(--text-secondary);
    font-size: 0.65rem;
    letter-spacing: 0.05rem;
}

.file-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 217, 255, 0.15);
    color: var(--neon-blue);
    font-size: 0.6rem;
    letter-spacing: 0.05rem;
    width: fit-content;
}

.file-type--system {
    background: rgba(123, 167, 188, 0.15);
    color: var(--text-secondary);
}

.file-type--network {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success-green);
}

.file-link {
    color: var(--text-primary);
    font-size: 0.85rem;
}

a.file-card:hover .file-link {
    color: var(--neon-blue);
}

/* ============================================
   FOOTER
   ============================================ */

.hub-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(5, 8, 17, 0.95);
    border-top: 1px solid rgba(0, 217, 255, 0.3);
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.03rem;
    line-height: 1.6;
}

.footer-version {
    margin-top: 0.25rem;
    opacity: 0.5;
    font-size: 0.6rem;
}

/* ============================================
   BEGIN BRIEFING
   ============================================ */

.begin-briefing {
    margin-bottom: 2.5rem;
}

.briefing-container {
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid rgba(0, 217, 255, 0.3);
    padding: 1.5rem;
}

.briefing-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0.05rem;
}

.briefing-steps {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.briefing-step {
    flex: 1;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: all 0.3s ease;
}

.briefing-step:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 217, 255, 0.1);
    transform: translateY(-2px);
}

.step-number {
    color: var(--neon-blue);
    font-size: 0.65rem;
    letter-spacing: 0.15rem;
    opacity: 0.6;
}

.step-label {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.1rem;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.briefing-arrow {
    color: var(--neon-blue);
    font-size: 1.2rem;
    opacity: 0.4;
    flex-shrink: 0;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* ============================================
   RESPONSIVE — TABLET (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Show hamburger */
    .hamburger {
        display: flex;
    }

    /* Hide logout on small screens — it's accessible via menu */
    .logout-btn {
        display: none;
    }

    /* Header adjustments */
    .hub-header {
        padding: 0.75rem 1rem;
    }

    .header-title {
        font-size: 0.85rem;
    }

    .header-subtitle {
        font-size: 0.55rem;
    }

    .logo-small {
        width: 30px;
    }

    .clearance-badge {
        font-size: 0.6rem;
        padding: 0.3rem 0.5rem;
    }

    /* Nav becomes slide-down panel */
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(5, 8, 17, 0.98);
        border-bottom: 2px solid var(--neon-blue);
        transform: translateY(-100%);
        transition: transform 0.35s ease;
        overflow-x: visible;
        overflow-y: auto;
        max-height: 100vh;
        padding-top: 60px; /* Clear the header */
        z-index: 99;
        gap: 0;
    }

    .main-nav.open {
        transform: translateY(0);
    }

    .nav-link {
        padding: 1rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(0, 217, 255, 0.1);
        font-size: 0.85rem;
        text-align: left;
    }

    .nav-link.active {
        border-bottom-color: var(--neon-blue);
        border-left: 3px solid var(--neon-blue);
    }

    /* Add logout link at bottom of mobile nav */
    .main-nav::after {
        content: '';
        display: block;
        padding: 0.5rem;
    }

    /* Content */
    .hub-content {
        padding: 1.25rem 1rem;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Status */
    .status-container {
        padding: 1rem;
    }

    .status-message {
        font-size: 0.85rem;
        padding-left: 1rem;
    }

    /* Files */
    .file-card {
        padding: 0.85rem 1rem;
    }

    .file-link {
        font-size: 0.8rem;
    }

    /* Briefing */
    .briefing-steps {
        flex-direction: column;
    }

    .briefing-arrow {
        transform: rotate(90deg);
        font-size: 1rem;
    }

    .briefing-step {
        width: 100%;
    }

    /* Login */
    .login-container {
        padding: 2rem 1.5rem;
    }

    .glitch-text {
        font-size: 2rem;
        letter-spacing: 0.2rem;
    }

    .subtitle {
        font-size: 0.75rem;
        letter-spacing: 0.1rem;
    }
}

/* ============================================
   RESPONSIVE — SMALL PHONE (max-width: 420px)
   ============================================ */

@media (max-width: 420px) {
    .header-title {
        font-size: 0.75rem;
        letter-spacing: 0.05rem;
    }

    .header-subtitle {
        display: none;
    }

    .glitch-text {
        font-size: 1.75rem;
    }

    .hub-content {
        padding: 1rem 0.75rem;
    }

    .status-message {
        font-size: 0.8rem;
    }
}

/* ============================================
   GLOBAL SEARCH
   ============================================ */

.nav-search-toggle {
    cursor: pointer;
    font-size: 0.8rem;
}

.global-search-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: rgba(5, 8, 22, 0.98);
    border-bottom: 2px solid var(--neon-blue);
    padding: 1rem;
    box-shadow: 0 4px 30px rgba(0,217,255,0.15);
    backdrop-filter: blur(10px);
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

#global-search-input {
    flex: 1;
    background: rgba(0,217,255,0.05);
    border: 1px solid rgba(0,217,255,0.3);
    color: #fff;
    padding: 0.75rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
}

#global-search-input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0,217,255,0.2);
}

#global-search-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.search-close {
    background: none;
    border: 1px solid rgba(255,0,85,0.3);
    color: #FF0055;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 0;
}

.search-results {
    max-width: 700px;
    margin: 0.5rem auto 0;
    max-height: 60vh;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(0,217,255,0.08);
    transition: background 0.15s;
}

.search-result-item:hover {
    background: rgba(0,217,255,0.08);
}

.result-type {
    background: rgba(0,217,255,0.15);
    color: var(--neon-blue);
    padding: 0.15rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.05rem;
    white-space: nowrap;
}

.result-title {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.result-title mark {
    background: rgba(0,255,136,0.3);
    color: var(--success-green);
    padding: 0 2px;
}

.result-subtitle {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    white-space: nowrap;
}

.search-no-results {
    text-align: center;
    padding: 2rem;
    color: rgba(255,255,255,0.3);
    font-family: 'Courier New', monospace;
    font-style: italic;
}
