/* ============================================================
   MAGCARS Website — Manston Air Group
   Professional dark theme with aviation-inspired design
   ============================================================ */

/* ===== CSS Variables ===== */
:root {
    --primary: #0FA2D2;
    --primary-dark: #0B7FA6;
    --primary-light: #17BAEF;
    --primary-glow: rgba(15, 162, 210, 0.15);
    --bg: #0D1117;
    --bg-secondary: #161B22;
    --surface: #1C2333;
    --surface-hover: #242D3D;
    --card: #1C2333;
    --card-hover: #222D40;
    --border: #30363D;
    --border-light: #3D4450;
    --text: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #6E7681;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-heading: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.3);
    --transition: all 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; }

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navigation ===== */
.nav-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
}

.nav-brand img { height: 36px; }

.nav-brand .brand-text {
    color: var(--primary);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text);
    background: var(--surface);
}

.nav-links .nav-cta {
    background: var(--primary);
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-weight: 600;
}

.nav-links .nav-cta:hover {
    background: var(--primary-dark);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-user .callsign {
    color: var(--primary);
    font-weight: 600;
}

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
    }
    .nav-links.open { display: flex; }
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border);
    padding: 48px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    transform: translate(30%, -30%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
}

/* ===== Stats Bar ===== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 24px 0;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 162, 210, 0.1);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ===== Cards ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { border-color: var(--border-light); }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.card-body { padding: 20px; }

/* ===== Page Header ===== */
.page-header {
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Flight Report Specific ===== */
.flight-route-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 32px 20px;
    text-align: center;
}

.airport-code {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
}

.airport-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

.flight-route-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.flight-route-arrow .flight-num {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.flight-route-arrow .arrow-line {
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    position: relative;
}

.flight-route-arrow .arrow-line::after {
    content: '';
    position: absolute;
    right: -4px; top: -4px;
    border: 5px solid transparent;
    border-left: 8px solid var(--primary-light);
}

/* Score badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 700;
    border: 3px solid;
}

.score-excellent { border-color: var(--success); color: var(--success); background: rgba(16,185,129,0.1); }
.score-good { border-color: var(--primary); color: var(--primary); background: rgba(15,162,210,0.1); }
.score-fair { border-color: var(--warning); color: var(--warning); background: rgba(245,158,11,0.1); }
.score-poor { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.1); }

.score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    font-weight: 600;
}

/* Data rows */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .data-grid { grid-template-columns: 1fr; }
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.data-row:last-child { border-bottom: none; }

.data-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.data-value {
    font-weight: 600;
    text-align: right;
}

/* Skill analysis check/fail indicators */
.check-pass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 600;
    font-size: 0.85rem;
}

.check-pass::before { content: '✓'; font-size: 1rem; }

.check-fail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.85rem;
}

.check-fail::before { content: '✗'; font-size: 1rem; }

/* Landing rate colour coding */
.landing-greaser { color: #10B981; }
.landing-excellent { color: #10B981; }
.landing-good { color: #0FA2D2; }
.landing-acceptable { color: #3B82F6; }
.landing-firm { color: #F59E0B; }
.landing-hard { color: #EF4444; }

/* ===== Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:hover td {
    background: var(--surface-hover);
}

.data-table .mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-light);
    color: var(--text);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-approved { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-denied { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-live { background: rgba(239,68,68,0.15); color: var(--danger); animation: pulse 2s infinite; }

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

/* ===== Pilot Profile ===== */
.pilot-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid var(--primary);
}

.pilot-avatar img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== Live Map ===== */
.live-map-container {
    width: 100%;
    height: 600px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* ===== Flight Log ===== */
.flight-log {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
}

.flight-log .log-entry {
    padding: 2px 0;
}

.flight-log .log-time {
    color: var(--text-muted);
}

.flight-log .log-warning {
    color: var(--warning);
}

.flight-log .log-error {
    color: var(--danger);
}

/* ===== Altitude Chart ===== */
.altitude-chart {
    width: 100%;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 48px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-brand span { color: var(--primary); font-weight: 600; }

.footer-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover { color: var(--primary); }

/* ===== Utility ===== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== Airline tag colours ===== */
.airline-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.airline-mse { background: rgba(15,162,210,0.15); color: #0FA2D2; }
.airline-str { background: rgba(231,76,60,0.15); color: #E74C3C; }
.airline-vrn { background: rgba(46,204,113,0.15); color: #2ECC71; }
.airline-wym { background: rgba(243,156,18,0.15); color: #F39C12; }
