:root {
    /* Premium Dark Theme Core */
    --bg-color: #0b0f19;
    --bg-secondary: #131a2a;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;

    /* Vibrant Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.4);
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;

    /* Status Colors (Traffic / Wait Times) */
    --status-high: #ef4444;
    /* Congested / Long Wait */
    --status-high-glow: rgba(239, 68, 68, 0.3);
    --status-med: #f59e0b;
    /* Busy / Med Wait */
    --status-low: #10b981;
    /* Clear / Short Wait */

    /* UI Elements */
    --glass-bg: rgba(19, 26, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow: hidden;
    /* App-like background gradient */
    background: radial-gradient(circle at top right, #1a233a 0%, var(--bg-color) 40%);
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Base App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    /* For mobile browsers */
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.neon-border {
    position: relative;
}

.neon-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    z-index: -1;
    opacity: 0.5;
    filter: blur(3px);
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    z-index: 10;
}

.logo h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--status-high);
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulsing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--status-high);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--status-high);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

/* Main Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 100px;
    /* Padding for bottom nav */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Momentum scrolling for iOS */
    overscroll-behavior-y: contain;
    /* Prevents scroll chaining to the non-scrollable body */
}

.content-area::-webkit-scrollbar {
    display: none;
}

/* Views Management */
.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    margin-bottom: 24px;
}

.view-header h2 {
    font-size: 28px;
    margin-bottom: 4px;
}

.view-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ---------------------------------
   MAP VIEW
--------------------------------- */
.map-container {
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map-tools {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.tool-btn.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px var(--accent-blue-glow);
}

.stadium-graphic {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.stadium-svg {
    width: 100%;
    height: auto;
    display: block;
}

.field {
    fill: rgba(16, 185, 129, 0.1);
    stroke: var(--status-low);
    stroke-width: 2;
}

/* Heatmap Zones */
.zone {
    opacity: 0.7;
    transition: fill 2s ease;
    mix-blend-mode: screen;
}

.heat-high {
    fill: var(--status-high);
    filter: drop-shadow(0 0 8px var(--status-high-glow));
    animation: heatPulse 4s infinite alternate;
}

.heat-med {
    fill: var(--status-med);
}

.heat-low {
    fill: var(--status-low);
    opacity: 0.3;
}

@keyframes heatPulse {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 0.9;
    }
}

.poi {
    stroke: #fff;
    stroke-width: 2px;
}

.poi-food {
    fill: var(--accent-blue);
}

.poi-restroom {
    fill: var(--accent-cyan);
}

.poi-exit {
    fill: var(--status-med);
}

.route-path {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 3;
    animation: dash 2s linear infinite;
}

.user-location {
    fill: #fff;
    filter: drop-shadow(0 0 5px #fff);
}

@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

.map-legend {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 12px;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.color-high {
    background: var(--status-high);
    box-shadow: 0 0 5px var(--status-high);
}

.color-med {
    background: var(--status-med);
}

.color-low {
    background: var(--status-low);
}

/* Guidance Panel */
.smart-guidance {
    display: flex;
    gap: 16px;
    padding: 16px;
    align-items: center;
}

.guidance-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

.guidance-text h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: #fff;
}

.guidance-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------------------------------
   WAIT TIMES VIEW
--------------------------------- */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.tab.active {
    color: #fff;
    border-bottom-color: var(--accent-blue);
    font-weight: 500;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.queue-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.queue-status {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.state-busy {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-high);
}

.state-med {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-med);
}

.state-clear {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-low);
}

.queue-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.queue-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.queue-actions .btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

.progress-bar-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 16px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 2px;
}

.progress-bar.state-busy {
    background: var(--status-high);
    box-shadow: 0 0 8px var(--status-high);
}

.progress-bar.state-med {
    background: var(--status-med);
    box-shadow: 0 0 8px var(--status-med);
}

.progress-bar.state-clear {
    background: var(--status-low);
    box-shadow: 0 0 8px var(--status-low);
}

/* ---------------------------------
   FEED VIEW
--------------------------------- */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-item {
    display: flex;
    gap: 16px;
    padding: 16px;
}

.border-warning {
    border-left: 4px solid var(--status-high);
}

.feed-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.feed-content h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.feed-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.feed-time {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Special Flash Offer Animation */
.flash-offer {
    border: 1px solid var(--accent-purple);
}

.flash-offer .feed-icon {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-purple);
}

/* ---------------------------------
   ITINERARY VIEW (TIMELINE)
--------------------------------- */
.timeline-container {
    position: relative;
    padding-left: 8px;
    margin-top: 16px;
}

.timeline-line {
    position: absolute;
    left: 23px;
    top: 5px;
    bottom: 20px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 40px;
}

.timeline-dot {
    position: absolute;
    left: 10px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    z-index: 2;
    border: 3px solid var(--bg-color);
}

.timeline-item.past .timeline-dot {
    background: var(--text-secondary);
}

.timeline-item.active .timeline-dot {
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.timeline-item.active .timeline-dot.pulsing {
    animation: pulse 2s infinite;
}

.timeline-item.future .timeline-dot {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.3);
}

.timeline-content {
    padding: 16px;
    position: relative;
}

.border-highlight {
    border-left: 4px solid var(--accent-cyan);
}

.timeline-time {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-content h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: #fff;
}

.timeline-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------------------------------
   BOTTOM NAV
--------------------------------- */
.bottom-nav {
    position: absolute;
    bottom: 24px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-around;
    padding: 12px 8px;
    z-index: 100;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    width: 80px;
}

.nav-btn span {
    font-size: 11px;
    font-weight: 500;
}

.nav-btn svg {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn.active {
    color: var(--accent-blue);
}

.nav-btn.active svg {
    transform: translateY(-4px);
    filter: drop-shadow(0 4px 6px var(--accent-blue-glow));
}

.nav-btn.active span {
    color: #fff;
}

.badge-indicator {
    position: absolute;
    top: -2px;
    right: 24px;
    width: 8px;
    height: 8px;
    background: var(--status-high);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--status-high);
}

/* ---------------------------------
   ADVANCED FEATURES (IN-SEAT & AR)
--------------------------------- */

/* Map Enhancements */
#stadium-container {
    cursor: grab;
}

#stadium-container:active {
    cursor: grabbing;
}

/* Friend Locator Additions */
.friend-aura {
    animation: friendPulse 1.5s infinite alternate;
    mix-blend-mode: screen;
}

@keyframes friendPulse {
    0% {
        opacity: 0.4;
        r: 12;
    }

    100% {
        opacity: 0.8;
        r: 16;
    }
}

.delivery-runner {
    fill: #22c55e;
    filter: drop-shadow(0 0 10px #22c55e);
    animation: pulseDelivery 1.5s infinite alternate;
    transition: cx 0.5s linear, cy 0.5s linear;
}

@keyframes pulseDelivery {
    0% {
        r: 5;
        opacity: 0.8;
    }

    100% {
        r: 8;
        opacity: 1;
        filter: drop-shadow(0 0 15px #22c55e);
    }
}

.btn-delivery {
    margin-top: 8px;
    border: none;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* AR View Simulation */
.ar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ar-header {
    z-index: 10;
}

.ar-camera-mock {
    position: relative;
    flex: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: url('https://images.unsplash.com/photo-1540747913346-19e32dc3e97e?q=80&w=600&auto=format&fit=crop') center/cover;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Simulated Blur for depth */
.ar-camera-mock::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(4px) brightness(0.6);
    -webkit-backdrop-filter: blur(4px) brightness(0.6);
    z-index: 1;
}

.ar-scene {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    perspective: 800px;
    /* 3D depth */
    display: flex;
    justify-content: center;
    align-items: center;
}

.ar-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ar-arrow-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: floatArrow 3s ease-in-out infinite;
}

.ar-arrow-content span {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 10px rgba(6, 182, 212, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: -10px;
    backdrop-filter: blur(4px);
}

@keyframes floatArrow {

    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.4));
    }

    50% {
        transform: translateY(-20px) scale(1.05);
        filter: drop-shadow(0 0 25px rgba(6, 182, 212, 0.8));
    }
}

.ar-hud {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    width: 85%;
}

.ar-dist {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

.ar-instructions {
    font-size: 12px;
    color: #aaa;
}

/* Modal UI */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    padding: 32px;
    text-align: center;
    position: relative;
    width: 80%;
    max-width: 320px;
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-cyan);
}

.modal-content h2 {
    margin-bottom: 8px;
    color: var(--accent-cyan);
    font-size: 24px;
}

.modal-content p {
    font-size: 14px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.modal-content .ar-instructions {
    margin-top: 16px;
    margin-bottom: 0;
}

.qr-box {
    background: #fff;
    padding: 16px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* ---------------------------------
   FAN ENGAGEMENT GLOBAL PULSE
--------------------------------- */
body.celebration-active {
    animation: stadiumPulse 3s ease-out;
}

@keyframes stadiumPulse {
    0% {
        box-shadow: inset 0 0 0px rgba(6, 182, 212, 0);
    }

    10% {
        box-shadow: inset 0 0 150px rgba(6, 182, 212, 0.8), inset 0 0 50px rgba(245, 158, 11, 0.8);
    }

    30% {
        box-shadow: inset 0 0 200px rgba(6, 182, 212, 1), inset 0 0 100px rgba(245, 158, 11, 1);
    }

    100% {
        box-shadow: inset 0 0 0px rgba(6, 182, 212, 0);
    }
}

.celebration-active .bottom-nav {
    border-top-color: var(--accent-cyan);
    box-shadow: 0 -10px 40px rgba(6, 182, 212, 0.5);
    transition: all 0.5s;
}

.celebration-active .nav-btn {
    animation: navPulse 3s ease-out;
}

@keyframes navPulse {

    0%,
    100% {
        color: var(--text-secondary);
        filter: brightness(1);
    }

    30% {
        color: var(--accent-cyan);
        filter: drop-shadow(0 0 10px var(--accent-cyan)) brightness(2);
    }
}