/* ============================================================================
   SQUAWK - Airline Ops Message Translator
   Design focused on CLARITY and READABILITY
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Functional colors - semantic meaning only */
    --bg-dark: #0a0a0a;
    --bg-card: #111113;
    --bg-input: #fafafa;
    --bg-box: rgba(255, 255, 255, 0.03);

    --text-primary: #f0f0f0; /* Slightly brighter */
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --text-label: #888;

    /* Semantic colors */
    --color-arrival: #22c55e;
    --color-departure: #3b82f6;
    --color-warning: #f59e0b;

    --border-color: rgba(255, 255, 255, 0.1); /* Slightly higher contrast */

    --radius: 8px; /* Slightly rounder */
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-dark);
    color: var(--text-secondary);
    min-height: 100vh;
    padding: 1.5rem;
    line-height: 1.5;
    font-size: 15px;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

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

header {
    text-align: center;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.8rem; /* Restored size */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
    text-transform: lowercase; /* Ensure lowercase */
}

.tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================================
   INPUT
   ============================================================================ */

.input-section {
    margin-bottom: 1.5rem;
}

#input-text {
    width: 100%;
    min-height: 180px;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--bg-input);
    color: #1a1a1a;
    border: none;
    border-radius: var(--radius);
    resize: vertical;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#input-text:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

.btn {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.btn-primary:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
}

/* ============================================================================
   OUTPUT CARD
   ============================================================================ */

.output-section {
    margin-top: 2rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px; /* Reduced padding */
    border-bottom: 1px solid var(--border-color);
    /* Removed background color for seamless window look */
}

.window-controls {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px; /* Restored size */
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.card-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: lowercase; /* Lowercase for consistency */
}

.card-body {
    padding: 1.25rem;
}

.watermark {
    text-align: right;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.4;
    border-top: 1px solid rgba(255,255,255,0.03);
}

/* ============================================================================
   FLIGHT SECTIONS
   ============================================================================ */

.flight-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
}

.flight-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Section Header */
.section-header {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 4px;
}

.section-header.arriving {
    color: var(--color-arrival);
    background: rgba(34, 197, 94, 0.15);
}

.section-header.departing {
    color: var(--color-departure);
    background: rgba(59, 130, 246, 0.15);
}

/* Flight Header - flight info left, time box right */
.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.flight-info {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.flight-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.flight-route {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

.flight-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Time box - small info card on right */
.time-box {
    background: var(--bg-box);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    text-align: justify;
    flex-shrink: 0;
}

.time-box .time-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.15rem;
}

.time-box .time-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

/* ============================================================================
   INFO GRID
   ============================================================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.info-box {
    background: var(--bg-box);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-box .value {
    font-size: 1rem; /* Readable but compact */
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.info-box .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.info-box.nil .value {
    color: var(--text-muted);
}

/* Subtle note styling for things like "might change" */
.info-box .value .note {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ============================================================================
   PASSENGER TABLE
   ============================================================================ */

.pax-section {
    margin-bottom: 1.25rem;
}

.pax-section-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.pax-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.pax-box {
    background: var(--bg-box);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.65rem 0.8rem;
    text-align: center;
    flex: 1;
    min-width: 70px;
}

.pax-box .count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.pax-box .type {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.pax-box.total {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.pax-box.total .count {
    color: #60a5fa;
}

/* ============================================================================
   SPECIAL INFO BLOCKS
   ============================================================================ */

.special-box {
    background: var(--bg-box);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
}

.special-box:last-child {
    margin-bottom: 1.25rem;
}

.special-box .header {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.special-box .details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Warning styling for special assistance */
.special-box.assist {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.special-box.assist .header {
    color: var(--color-warning);
}

/* Cargo items section */
.special-box.cargo-section {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.special-box.cargo-section .details {
    color: #c7d2fe;
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover:not(:disabled) {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-action.success {
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--color-arrival);
    background: rgba(34, 197, 94, 0.05);
}

.btn-action .btn-icon {
    font-size: 0.9rem;
}

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

@media (max-width: 600px) {
    body {
        padding: 1rem;
        font-size: 14px;
    }

    header {
        margin-bottom: 1.5rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .flight-header {
        flex-wrap: wrap;
    }

    .flight-number {
        font-size: 1.3rem;
    }

    .flight-route {
        font-size: 0.8rem;
    }

    .time-box {
        padding: 0.4rem 0.6rem;
    }

    .time-box .time-value {
        font-size: 1rem;
    }

    .time-box .time-label {
        font-size: 0.55rem;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .info-box {
        padding: 0.6rem;
    }

    .info-box .value {
        font-size: 0.9rem;
    }

    .pax-box {
        min-width: calc(33% - 0.5rem);
        padding: 0.5rem;
    }

    .pax-box .count {
        font-size: 1.1rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-action {
        justify-content: center;
        width: 100%;
        padding: 0.75rem;
    }
}

/* ============================================================================
   PRINT / EXPORT STYLES
   ============================================================================ */

@media print {
    body {
        background: white;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .action-buttons {
        display: none;
    }
}
