/* --- METEOFACE AVIATION MODULE STYLE --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=JetBrains+Mono:wght@500;800&display=swap');

:root {
    --accent: #f1c40f;
    --accent-dim: rgba(241, 196, 15, 0.15);
    --bg: #0b0e17;
    --vfr: #2ecc71;
    --ifr: #e74c3c;
    --glass: rgba(16, 18, 27, 0.85);
    --surface: rgba(11, 14, 23, 0.88);
    --surface-2: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.45);
    --cyan: #00e5ff;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --blur: blur(14px) saturate(180%);
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: white;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    touch-action: none;
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
    touch-action: pan-x pan-y;
}

/* --- ÜST BAR TASARIMI --- */
.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
}

.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    height: 56px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.brand-module {
    font-size: 10px;
    font-weight: 600;
    color: var(--cyan);
    letter-spacing: 0.5px;
}

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrap i {
    position: absolute;
    left: 10px;
    color: var(--accent);
    font-size: 12px;
    pointer-events: none;
}

#icao-search {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 8px 12px 8px 30px;
    width: 170px;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    transition: 0.3s;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

/* --- ARAMA SONUÇLARI (AUTOCOMPLETE) --- */
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-y: auto;
    max-height: 260px;
    z-index: 1100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.search-result-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--accent-dim);
}

.sr-icao {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 11px;
    color: var(--accent);
    flex-shrink: 0;
}

.sr-name {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- ANALİZ PENCERESİ (MODAL) --- */
.analysis-window {
    position: absolute;
    z-index: 2000;
    width: 380px;
    background: rgba(11, 14, 23, .97);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(241, 196, 15, .2);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
    max-height: 80vh;
    touch-action: auto;
    top: 80px;
    left: 20px;
    /* TopBar altına çekildi */
}

.window-header {
    padding: 14px 18px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: .05em;
}

.window-content {
    padding: 16px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(241, 196, 15, .3) transparent;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    flex: 1;
    min-height: 0;
}

.window-content::-webkit-scrollbar {
    width: 4px;
}

.window-content::-webkit-scrollbar-thumb {
    background: rgba(241, 196, 15, .3);
    border-radius: 2px;
}

.control-btn {
    background: none;
    border: 1px solid var(--border);
    color: #888;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}

.control-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* --- SEKMELER --- */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.tabs button {
    flex: 1;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    color: #888;
    padding: 7px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter';
    font-weight: 700;
    font-size: 9px;
    letter-spacing: .06em;
    transition: .2s;
}

.tabs button.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* --- BAYAT VERİ UYARISI --- */
.stale-warning {
    background: rgba(243, 156, 18, .12);
    border: 1px solid #f39c12;
    color: #f39c12;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* --- KATEGORİ BADGE --- */
.cat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 12px;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- 2-KOLON GRID --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.info-tile {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.tile-label {
    font-size: 8px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 5px;
}

.tile-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

/* --- VERİ KARTLARI --- */
.data-card {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.data-header {
    font-size: 9px;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 8px;
}

.data-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    line-height: 1.7;
    color: #e0e0e0;
}

/* --- TEHLİKE GRID --- */
.hazard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.hazard-card {
    border: 1px solid;
    border-radius: 12px;
    padding: 10px 12px;
    transition: .2s;
}

.haz-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.haz-name {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    color: #bbb;
    flex: 1;
}

/* --- TAF PERİYOTLARI --- */
.taf-period {
    border-left: 2px solid rgba(241, 196, 15, .3);
    padding: 8px 12px;
    margin-bottom: 8px;
}

.taf-time {
    font-size: 9px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 4px;
}

.taf-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: #ccc;
}

/* --- İSTASYON SATIRLARI --- */
.st-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-size: 11px;
}

.st-row span:first-child {
    color: #888;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
}

/* --- MARKER --- */
.airport-marker {
    cursor: pointer;
    z-index: 50 !important;
}

.marker-content {
    background: rgba(11, 14, 23, .95);
    border: 1.5px solid var(--accent);
    color: var(--accent);
    padding: 5px 8px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: .2s;
}

.icao-label {
    font-size: 9px;
    font-weight: 900;
    color: #fff;
}

/* --- MOBİL --- */
@media (max-width:600px) {
    .brand-module {
        display: none;
    }

    #icao-search {
        width: 120px;
    }

    .analysis-window {
        width: 95vw;
        top: 75px !important;
        left: 2.5vw !important;
    }

    .hazard-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   SAĞ DİKEY MENÜ (STYLE DOCK)
============================================= */
.style-dock {
    position: absolute;
    right: 14px;
    top: 88px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(11, 14, 23, 0.88);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.style-dock .style-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.style-dock .style-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.style-dock .style-btn.active {
    background: rgba(241, 196, 15, 0.15);
    border-color: #f1c40f;
    color: #f1c40f;
}

.style-dock .flag-img {
    width: 20px;
    height: auto;
    border-radius: 2px;
    display: block;
}

@media (max-width: 768px) {
    .style-dock {
        right: 8px;
        top: 78px;
        gap: 4px;
        padding: 4px;
    }
    .style-dock .style-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .style-dock .flag-img {
        width: 17px;
    }
}