/* ============================================================
   Flykort Map Page — Full-screen layout
   ============================================================ */

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

:root {
    --bg:       #070b13;
    --bg2:      #0d1424;
    --bg-panel: #0c1322;
    --accent:   #3b82f6;
    --accent2:  #22d3ee;
    --text:     #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim:   #64748b;
    --border:   rgba(59, 130, 246, 0.15);
    --nav-h:    48px;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ---- Nav bar --------------------------------------------- */

.map-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    background: rgba(7, 11, 19, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.map-nav__back {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: color 0.18s;
    white-space: nowrap;
}
.map-nav__back:hover { color: var(--text); }

.map-nav__logo {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.map-nav__airport {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    white-space: nowrap;
}

/* ---- Shell ----------------------------------------------- */

.map-shell {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0; bottom: 0;
    display: flex;
}

/* ---- Sidebar --------------------------------------------- */

.map-sidebar {
    width: 270px;
    flex-shrink: 0;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.map-sidebar__header {
    padding: 1.1rem 1.1rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.map-sidebar__icao {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.06em;
}

.map-sidebar__name {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.35;
}

.map-sidebar__section {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.map-sidebar__label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
}

/* Selects */
.map-select {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 0.5rem;
}

.map-select:focus { border-color: var(--accent); }
.map-select option { background: #0d1424; }

/* Checkbox */
.map-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
}

.map-check input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Flight info panel */
.map-flight-info {
    display: none;
    padding: 1.1rem;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.map-flight-info.visible { display: flex; }

.map-flight-callsign {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.map-flight-row {
    display: flex;
    gap: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

.map-flight-row strong {
    color: var(--text-dim);
    font-weight: 600;
    min-width: 62px;
    flex-shrink: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 0.1rem;
}

.map-flight-row span { color: var(--text-muted); }

.map-flight-route {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    word-break: break-all;
    line-height: 1.5;
}

.map-flight-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: -0.25rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.map-flight-close:hover { color: var(--text); }

/* Spacer to push things to bottom */
.map-sidebar__spacer { flex: 1; }

/* ---- Map container --------------------------------------- */

#leaflet-map {
    flex: 1;
    height: 100%;
}

.leaflet-tile {
    filter: brightness(0.88) contrast(1.15) saturate(0.75);
}

/* ---- Airplane icons (unchanged from original) ------------ */

.airplane-leaflet {
    background-color: transparent;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.airplane-bg {
    background-color: transparent;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    opacity: 0.5;
    justify-content: center;
    align-items: center;
}

.airplane-icon-wrapper {
    text-align: center;
    color: white;
    font-size: 11px;
    pointer-events: none;
    user-select: none;
}

.airplane-wrapper {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.airplane-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.airplane-label {
    margin-top: 2px;
    color: white;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    padding: 2px 4px;
    display: inline-block;
}

.airplane-label .route {
    font-size: 10px;
    opacity: 0.8;
}

.airplane-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.airplane-plate {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 6px;
    margin-top: 64px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1;
}
