/* Airbus Takeoff Performance Calculator Stylesheet */
/* Modern EFB + Airbus MCDU Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Share+Tech+Mono&family=VT323&display=swap');

:root {
    --bg-dark: #0a0e17;
    --bg-card: rgba(22, 30, 46, 0.85);
    --bg-card-border: rgba(45, 60, 88, 0.6);
    --bg-input: #121824;
    --accent-blue: #38bdf8;
    --accent-blue-glow: rgba(56, 189, 248, 0.25);
    --accent-green: #22c55e;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    /* Airbus MCDU Palette */
    --mcdu-bezel-bg: linear-gradient(145deg, #373e48, #252a32);
    --mcdu-screen-bg: #030a05;
    --mcdu-green: #00ff66;
    --mcdu-amber: #ffb000;
    --mcdu-cyan: #00e5ff;
    --mcdu-white: #ffffff;
    --mcdu-magenta: #ff00ff;
    --mcdu-red: #ff3344;
    --mcdu-font: 'Share Tech Mono', 'Courier New', monospace;
}



* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

body {
    background: radial-gradient(circle at 50% 20%, #172033 0%, #080c14 100%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#app {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.brand-title h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-title p {
    font-size: 12px;
    color: var(--text-muted);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    color: var(--accent-green);
    font-size: 13px;
    font-weight: 600;
}

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

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Main Grid Layout */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 24px;
}

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

/* Input Cards (EFB Style) */
.efb-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

select.form-control {
    cursor: pointer;
}

/* Button Pills & Toggles */
.btn-group {
    display: flex;
    gap: 6px;
}

.btn-pill {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-pill.active {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
}

.btn-pill:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-action {
    padding: 10px 16px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

/* Airport Lookup Dropdown */
.airport-select-wrapper {
    position: relative;
}

.airport-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: #111724;
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.airport-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}

.airport-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
}

/* Computed Wind Badges */
.wind-readout {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 13px;
}

.wind-badge {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.wind-badge.headwind {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.wind-badge.tailwind {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.wind-badge.crosswind {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* ------------------------------------------------------------- */
/* AIRBUS MCDU DISPLAY HARDWARE BEZEL */
/* ------------------------------------------------------------- */

.mcdu-container {
    position: sticky;
    top: 20px;
}

.mcdu-bezel {
    background: var(--mcdu-bezel-bg);
    border: 4px solid #1a1e24;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Top MCDU Annunciator LEDs */
.mcdu-annunciators {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 10px;
}

.mcdu-led {
    font-family: var(--mcdu-font);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    background: #151921;
    border: 1px solid #2d3440;
    border-radius: 4px;
    color: #4a5568;
    text-transform: uppercase;
}

.mcdu-led.active {
    color: var(--mcdu-amber);
    box-shadow: 0 0 10px rgba(255, 176, 0, 0.4);
    border-color: var(--mcdu-amber);
}

/* CRT Screen Frame */
.mcdu-screen-frame {
    background: var(--mcdu-screen-bg);
    border: 3px solid #11151c;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.9);
}

/* CRT Scanlines Overlay */
.mcdu-screen-frame::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.7;
}

/* MCDU Monospace Typography & Grid */
.mcdu-screen {
    font-family: var(--mcdu-font);
    color: var(--mcdu-green);
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.6);
    line-height: 1.35;
    user-select: none;
}

/* Page Header */
.mcdu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(0, 255, 102, 0.3);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.mcdu-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mcdu-white);
}

.mcdu-page-num {
    font-size: 14px;
    color: var(--mcdu-cyan);
}

/* Lines 1L to 6L & 1R to 6R */
.mcdu-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.mcdu-label {
    font-size: 11px;
    color: var(--mcdu-cyan);
    text-shadow: none;
    text-transform: uppercase;

    &.amber {
        color: var(--mcdu-amber);
    }

    &.right {
        text-align: right;
    }
}

.mcdu-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--mcdu-green);

    &.cyan {
        color: var(--mcdu-cyan);
    }

    &.amber {
        color: var(--mcdu-amber);
        text-shadow: 0 0 5px rgba(255, 176, 0, 0.6);
    }

    &.white {
        color: var(--mcdu-white);
    }

    &.toga {
        color: var(--mcdu-red);
        text-shadow: 0 0 8px rgba(255, 51, 68, 0.8);
    }

    &.right {
        text-align: right;
    }
}

/* Scratchpad & Message Line */
.mcdu-scratchpad {
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 255, 102, 0.3);
    min-height: 24px;
    font-size: 13px;
    color: var(--mcdu-amber);
    display: flex;
    justify-content: space-between;
}

.mcdu-warning {
    color: var(--mcdu-red);
    font-weight: 700;
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.3;
    }
}

/* MCDU Keypad Buttons below screen */
.mcdu-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.mcdu-btn {
    padding: 10px;
    background: linear-gradient(145deg, #2b3038, #1c2026);
    border: 1px solid #4a5260;
    border-radius: 8px;
    color: #e2e8f0;
    font-family: var(--mcdu-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.1s ease;
    text-align: center;
}

.mcdu-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    background: #171a1e;
}

.mcdu-btn.active {
    border-color: var(--mcdu-cyan);
    color: var(--mcdu-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* Footer info */
.app-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: var(--text-muted);
}