/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Color Palette */
    --color-bg-primary: #0f0f1e;
    --color-bg-secondary: #1a1a2e;
    --color-bg-card: #232337;
    --color-bg-card-hover: #2a2a42;
    
    --color-text-primary: #f5f5f7;
    --color-text-secondary: #a1a1aa;
    --color-text-tertiary: #71717a;
    
    --color-accent-primary: #4ade80;
    --color-accent-secondary: #f472b6;
    --color-accent-info: #60a5fa;
    
    --color-success: #22c55e;
    --color-warning: #eab308;
    --color-danger: #ef4444;
    
    --color-border: #3a3a4e;
    --color-border-light: #4a4a5e;
    
    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography Scale */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3rem;
    
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(74, 222, 128, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 400ms ease-in-out;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    min-height: 100vh;
    padding: var(--space-lg);
    line-height: var(--line-height-normal);
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-accent-primary);
    color: var(--color-bg-primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-sm);
}

.skip-to-content:focus {
    left: var(--space-md);
    top: var(--space-md);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-accent-primary);
    margin-bottom: var(--space-md);
    text-shadow: var(--shadow-glow);
    letter-spacing: -0.02em;
    line-height: var(--line-height-tight);
}

.disclaimer {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    max-width: 600px;
    margin: 0 auto;
}

.disclaimer strong {
    color: var(--color-accent-secondary);
    font-weight: var(--font-weight-semibold);
}

.disclaimer a {
    color: var(--color-accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.disclaimer a:hover {
    color: var(--color-accent-primary);
    border-bottom-color: var(--color-accent-primary);
}

.disclaimer a:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.external-link-icon {
    font-size: 0.85em;
    opacity: 0.7;
    margin-left: 2px;
    display: inline-block;
    transition: opacity var(--transition-fast);
}

.disclaimer a:hover .external-link-icon {
    opacity: 1;
}

/* ============================================
   GAUGE SECTION
   ============================================ */
.gauge-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-2xl);
    padding: var(--space-2xl) var(--space-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.gauge {
    width: 320px;
    height: 180px;
    position: relative;
    margin-bottom: var(--space-lg);
}

.gauge-face {
    width: 320px;
    height: 160px;
    background: linear-gradient(180deg, var(--color-bg-card) 0%, var(--color-bg-secondary) 100%);
    border-radius: 160px 160px 0 0;
    border: 3px solid var(--color-border);
    border-bottom: none;
    position: relative;
    overflow: visible;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Add subtle tick marks at zone boundaries */
.gauge-face::before,
.gauge-face::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 25px;
    background: var(--color-border-light);
    transform-origin: bottom center;
}

/* Left tick mark (between Plenty and Some) */
.gauge-face::before {
    transform: translateX(-50%) rotate(-45deg);
}

/* Right tick mark (between Some and Limited) */
.gauge-face::after {
    transform: translateX(-50%) rotate(45deg);
}

.gauge-label {
    position: absolute;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gauge-label.left { 
    bottom: 20px; 
    left: 25px; 
    color: var(--color-success);
}

.gauge-label.center { 
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-warning);
}

.gauge-label.right { 
    bottom: 20px; 
    right: 25px; 
    color: var(--color-danger);
}

.gauge-subtitle {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    text-align: center;
    max-width: 450px;
    line-height: var(--line-height-relaxed);
    font-weight: var(--font-weight-normal);
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 6px;
    height: 120px;
    background: var(--color-text-primary);
    transform-origin: bottom center;
    transform: rotate(-45deg);
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1), 
                background 0.3s ease,
                box-shadow 0.3s ease;
    border-radius: 3px 3px 0 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5),
                0 0 15px currentColor;
    filter: drop-shadow(0 0 8px currentColor);
}

.gauge-center {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: var(--color-bg-card);
    border-radius: 50%;
    border: 4px solid var(--color-text-primary);
    z-index: 11;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: border-color 0.3s ease;
}

.status-display {
    text-align: center;
}

.status-text {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    line-height: var(--line-height-tight);
}

/* Risk badges - kept for backward compatibility but not displayed prominently */
.risk-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.risk-low { background: var(--color-success); color: var(--color-bg-primary); }
.risk-medium { background: var(--color-warning); color: var(--color-bg-primary); }
.risk-high { background: var(--color-danger); color: var(--color-text-primary); }

.ratio-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

/* ============================================
   STATS ROW
   ============================================ */
.stats-row {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    box-shadow: var(--shadow-md);
    flex: 1;
    max-width: 400px;
}

.stat-card-hero {
    max-width: 500px;
    padding: var(--space-2xl);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-border-light);
}

.stat-card h3 {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: var(--font-weight-semibold);
}

.stat-value {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-accent-primary);
    line-height: var(--line-height-tight);
    letter-spacing: -0.02em;
}

/* ============================================
   PARKING LOTS CARDS
   ============================================ */
.lots-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.lot-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    border: 2px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.lot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-border);
    transition: background var(--transition-base);
}

/* Color coding based on availability - will be set via JS */
.lot-card.status-high::before { background: var(--color-success); }
.lot-card.status-medium::before { background: var(--color-warning); }
.lot-card.status-low::before { background: var(--color-danger); }

.lot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-light);
}

.lot-card-name {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
    font-weight: var(--font-weight-semibold);
}

.lot-card-spots {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
    line-height: var(--line-height-tight);
}

.lot-card-percent {
    font-size: var(--font-size-sm);
    color: var(--color-accent-primary);
    font-weight: var(--font-weight-medium);
}

/* ============================================
   FLIGHTS SECTION
   ============================================ */
.flights-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.flights-column {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.flights-column h3 {
    font-size: var(--font-size-base);
    color: var(--color-accent-primary);
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: var(--font-weight-semibold);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-border);
}

.flights-list {
    font-size: var(--font-size-sm);
}

.flight-header {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.6fr 1fr 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-xs);
    background: rgba(74, 222, 128, 0.05);
    border-radius: var(--radius-sm);
}

.flight-item {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.6fr 1fr 1fr;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
    transition: background var(--transition-fast), transform var(--transition-fast);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    position: relative;
    padding-left: var(--space-lg);
}

.flight-item:last-child {
    border-bottom: none;
}

.flight-item:hover {
    background: rgba(74, 222, 128, 0.05);
    transform: translateX(2px);
}

.flight-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: width var(--transition-fast);
}

.flight-item:hover::before {
    width: 4px;
}

.flight-item.arrival::before {
    background: var(--color-accent-info);
}

.flight-item.departure::before {
    background: var(--color-accent-secondary);
}

.flight-item.past-flight {
    opacity: 0.35;
}

.flight-item.past-flight:hover {
    opacity: 0.5;
}

.flight-item.past-flight .time-actual {
    color: var(--color-text-tertiary);
    text-decoration: line-through;
}

.time-actual {
    color: var(--color-accent-primary);
    font-weight: var(--font-weight-semibold);
    font-variant-numeric: tabular-nums;
}

.time-scheduled {
    color: var(--color-text-tertiary);
    text-decoration: line-through;
    font-size: 0.85em;
    font-variant-numeric: tabular-nums;
}

.no-flights {
    color: var(--color-text-tertiary);
    font-style: italic;
    text-align: center;
    padding: var(--space-xl) 0;
    font-size: var(--font-size-sm);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-2xl);
}

footer p {
    margin: var(--space-xs) 0;
    line-height: var(--line-height-relaxed);
}

#last-updated {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

#last-updated-relative.stale {
    color: #ef4444;
    font-weight: var(--font-weight-bold);
}

footer a {
    color: var(--color-accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

footer a:hover {
    color: var(--color-accent-primary);
    border-bottom-color: var(--color-accent-primary);
}

footer a:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-card) 0%,
        var(--color-bg-card-hover) 50%,
        var(--color-bg-card) 100%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets (Portrait and Landscape) */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
    
    .stat-card-hero {
        max-width: 600px;
    }
    
    .lots-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets (Portrait) and Large Phones */
@media (max-width: 768px) {
    body {
        padding: var(--space-md);
    }
    
    h1 {
        font-size: var(--font-size-3xl);
    }
    
    .gauge-section {
        padding: var(--space-xl) var(--space-md);
    }
    
    .gauge {
        width: 280px;
        height: 160px;
    }
    
    .gauge-face {
        width: 280px;
        height: 140px;
        border-radius: 140px 140px 0 0;
    }
    
    .gauge-face::before {
        height: 22px;
        transform: translateX(-50%) rotate(-45deg);
    }
    
    .gauge-face::after {
        height: 22px;
        transform: translateX(-50%) rotate(45deg);
    }
    
    .gauge-needle {
        height: 100px;
        width: 5px;
    }
    
    .stat-value {
        font-size: var(--font-size-4xl);
    }
    
    .lots-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .flights-row {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .flight-header,
    .flight-item {
        grid-template-columns: 1.2fr 1fr 0.5fr 1.2fr;
        font-size: var(--font-size-xs);
    }
    
    /* Hide the "Sched" column on smaller screens */
    .flight-header span:last-child,
    .flight-item span:last-child {
        display: none;
    }
}

/* Mobile Devices */
@media (max-width: 480px) {
    body {
        padding: var(--space-sm);
    }
    
    header {
        margin-bottom: var(--space-xl);
        padding-bottom: var(--space-lg);
    }
    
    h1 {
        font-size: var(--font-size-2xl);
    }
    
    .disclaimer {
        font-size: var(--font-size-xs);
    }
    
    .gauge-section {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .gauge {
        width: 240px;
        height: 140px;
    }
    
    .gauge-face {
        width: 240px;
        height: 120px;
        border-radius: 120px 120px 0 0;
    }
    
    .gauge-face::before {
        height: 20px;
        transform: translateX(-50%) rotate(-45deg);
    }
    
    .gauge-face::after {
        height: 20px;
        transform: translateX(-50%) rotate(45deg);
    }
    
    .gauge-needle {
        height: 85px;
        width: 4px;
    }
    
    .gauge-center {
        width: 24px;
        height: 24px;
        border-width: 3px;
    }
    
    .gauge-subtitle {
        font-size: var(--font-size-sm);
    }
    
    .status-text {
        font-size: var(--font-size-2xl);
    }
    
    .stats-row {
        width: 100%;
    }
    
    .stat-card {
        padding: var(--space-lg);
        max-width: 100%;
    }
    
    .stat-card-hero {
        max-width: 100%;
        padding: var(--space-xl);
    }
    
    .stat-value {
        font-size: var(--font-size-3xl);
    }
    
    .lots-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lot-card {
        padding: var(--space-md) var(--space-sm);
    }
    
    .lot-card-spots {
        font-size: var(--font-size-xl);
    }
    
    .flights-column {
        padding: var(--space-md);
    }
    
    .flight-header,
    .flight-item {
        grid-template-columns: 1fr 0.8fr 1fr;
        gap: var(--space-xs);
        padding: var(--space-sm);
        font-size: 0.7rem;
    }
    
    /* Hide Gate and Sched columns on mobile */
    .flight-header span:nth-child(3),
    .flight-header span:nth-child(5),
    .flight-item span:nth-child(3),
    .flight-item span:nth-child(5) {
        display: none;
    }
    
    footer {
        font-size: var(--font-size-xs);
        padding-top: var(--space-lg);
        margin-top: var(--space-xl);
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .gauge {
        width: 200px;
        height: 120px;
    }
    
    .gauge-face {
        width: 200px;
        height: 100px;
        border-radius: 100px 100px 0 0;
    }
    
    .gauge-face::before {
        height: 18px;
        transform: translateX(-50%) rotate(-45deg);
    }
    
    .gauge-face::after {
        height: 18px;
        transform: translateX(-50%) rotate(45deg);
    }
    
    .gauge-needle {
        height: 70px;
        width: 4px;
    }
    
    .lots-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .gauge-section,
    .stat-card,
    .lot-card,
    .flights-column {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}
