/* ═══════════════════════════════════════════════
   CYBERSPEED — Base Styles
   Reset, layout, and core elements
   ═══════════════════════════════════════════════ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: transparent;
    /* Required for Three.js background to show */
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── 3D Motion Background ── */
.three-container {
    position: fixed;
    inset: 0;
    z-index: -2;
    /* Behind the grid */
    pointer-events: none;
    background: var(--bg-primary);
    /* Use primary background here */
}

.three-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    filter: blur(0.5px);
    /* Soft sci-fi look */
}

/* ── Cyber Grid Background ── */
.cyber-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(var(--neon-cyan-rgb), 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--neon-cyan-rgb), 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ── Scanline Effect ── */
.scanline {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px);
}

/* ── HUD Top Bar ── */
.hud-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-sm) var(--sp-md);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-medium);
    height: 52px;
}

.hud-left,
.hud-right {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
}

.hud-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.logo-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 8px var(--neon-cyan));
}

.logo-text {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.logo-accent {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(var(--neon-cyan-rgb), 0.6);
}

/* GPS Status */
.gps-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(var(--neon-cyan-rgb), 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
}

.gps-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-yellow);
    box-shadow: 0 0 6px var(--neon-yellow);
    transition: background var(--transition-medium), box-shadow var(--transition-medium);
}

.gps-dot.active {
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    animation: pulse-dot 2s infinite;
}

.gps-dot.error {
    background: var(--neon-red);
    box-shadow: 0 0 8px var(--neon-red);
}

.gps-label {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Date-Time */
.date-time {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* HUD Buttons */
.hud-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(var(--neon-cyan-rgb), 0.08);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 1px;
}

.hud-btn:hover {
    background: rgba(var(--neon-cyan-rgb), 0.15);
    border-color: var(--neon-cyan);
    box-shadow: var(--shadow-neon-cyan);
}

.hud-btn:active {
    transform: scale(0.95);
}

/* ── Main Dashboard Layout ── */
.dashboard {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 36px;
    display: flex;
    z-index: 1;
    overflow: hidden;
}

/* ── Status Bar ── */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-lg);
    padding: var(--sp-xs) var(--sp-md);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-medium);
    height: 36px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
}

.status-item .status-label {
    color: var(--text-muted);
    letter-spacing: 1px;
}

.status-item .status-value {
    color: var(--neon-cyan);
}

.status-firebase {
    display: flex;
    align-items: center;
    gap: 6px;
}

.firebase-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-yellow);
    transition: background var(--transition-medium);
}

.firebase-dot.connected {
    background: var(--neon-green);
    box-shadow: 0 0 6px var(--neon-green);
}

.firebase-dot.error {
    background: var(--neon-red);
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 64px;
    right: var(--sp-md);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    max-width: 340px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-md);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--text-primary);
    animation: toast-in 0.4s ease forwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.toast.toast-success {
    border-color: rgba(var(--neon-green-rgb), 0.4);
}

.toast.toast-error {
    border-color: rgba(var(--neon-red-rgb), 0.4);
}

.toast.toast-info {
    border-color: rgba(var(--neon-cyan-rgb), 0.4);
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--neon-cyan-rgb), 0.3);
    border-radius: 2px;
}

/* ── Hidden Utility ── */
.hidden {
    display: none !important;
}