/* ŞarjNokta — aydınlık tema
   Harita karanlık kalmasın diye CARTO Voyager kullanılıyor; arayüz de ona uyumlu. */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-alt: #f0f2f5;
    --border: #e2e6ec;
    --border-strong: #cbd2dc;
    --text: #131820;
    --text-muted: #656f7d;
    --accent: #0f62fe;
    --accent-soft: #e5edff;

    /* Güç sınıfları — lejantla birebir aynı */
    --power-ultra: #7c3aed;
    --power-dc: #ea580c;
    --power-ac: #0d9488;
    --power-unknown: #94a3b8;

    --danger: #c0392b;
    --danger-soft: #fdecea;
    --success: #157347;
    --success-soft: #e6f4ec;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(19, 24, 32, .06), 0 4px 16px rgba(19, 24, 32, .06);

    --header-h: 56px;
    --footer-h: 44px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

/* min-height kullanılıyor: sabit height:100% içerik sayfalarında gövdeyi
   görüntü alanına hapsedip footer'ın metnin üstüne binmesine yol açıyordu. */
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }

pre {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem .9rem;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

code { font-size: .92em; }

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

/* ---------- Üst çubuk ---------- */

.app-header {
    height: var(--header-h);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
    font-size: 17px;
    letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 19px; }
.brand-text strong { font-weight: 700; }

.app-nav { display: flex; gap: 1.1rem; font-size: 14px; }
.app-nav a { color: var(--text-muted); }
.app-nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- Gövde ---------- */

.app-main { flex: 1 0 auto; min-height: 0; display: flex; flex-direction: column; }

.app-footer {
    flex: 0 0 auto;
    padding: .7rem 1.1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-muted);
}
.app-footer p { margin: 0; }

/* ---------- Harita düzeni ---------- */

/* Harita sayfası tam ekran kalsın: sayfa kaymaz, harita alanı sabit yükseklik alır.
   İçerik sayfaları ise normal akışta, footer metnin altında kalır. */
.map-shell {
    flex: 1 0 auto;
    height: calc(100vh - var(--header-h) - var(--footer-h));
    min-height: 420px;
    display: grid;
    grid-template-columns: 320px 1fr;
    position: relative;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 1.1rem;
}

.sidebar-title { font-size: 18px; }
.sidebar-lead { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.sidebar-section { padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.sidebar-section:last-child { border-bottom: 0; margin-bottom: 0; }

.filter-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-muted);
    margin-bottom: .7rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: 1.1rem;
}

.stat {
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: .55rem .6rem;
    text-align: center;
}
.stat-value { display: block; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: .1rem; }

.field { display: block; margin-bottom: .9rem; }
.field-label {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: .3rem;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: .45rem .55rem;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}
select:focus, input:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

input[type="range"] { width: 100%; accent-color: var(--accent); }

output { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }

.btn {
    display: inline-block;
    padding: .45rem .85rem;
    font: inherit;
    font-size: 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-strong);
    width: 100%;
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }

.legend { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: .5rem; padding: .18rem 0; }

.dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.dot-ultra { background: var(--power-ultra); }
.dot-dc { background: var(--power-dc); }
.dot-ac { background: var(--power-ac); }
.dot-unknown { background: var(--power-unknown); }

.rank-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.rank-list li {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .22rem 0;
    border-bottom: 1px dashed var(--border);
}
.rank-list li:last-child { border-bottom: 0; }

/* ---------- Harita ---------- */

.map-area { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--surface-alt); }

.map-status {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .3rem .85rem;
    font-size: 12.5px;
    color: var(--text-muted);
    box-shadow: var(--shadow);
}

/* Leaflet küme baloncukları — aydınlık temaya uyarlandı */
.marker-cluster {
    background: rgba(15, 98, 254, .18);
    border-radius: 50%;
}
.marker-cluster div {
    background: var(--accent);
    color: #fff;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    margin-top: 4px;
    border-radius: 50%;
    font: 600 12px/32px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
}

.station-marker {
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

/* ---------- Detay paneli ---------- */

.detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -6px 0 24px rgba(19, 24, 32, .07);
    overflow-y: auto;
    padding: 1.1rem;
    z-index: 900;
}

.detail-close {
    position: absolute;
    top: .5rem;
    right: .6rem;
    background: none;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: .2rem .4rem;
    border-radius: var(--radius-sm);
}
.detail-close:hover { background: var(--surface-alt); color: var(--text); }

.detail-title { font-size: 16px; margin-right: 1.5rem; }

.chip {
    display: inline-block;
    background: var(--accent-soft);
    color: #0a3fa8;
    border-radius: 999px;
    padding: .1rem .55rem;
    font-size: 12px;
    font-weight: 550;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .6rem;
    margin: 1rem 0;
}
.kv {
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: .5rem .65rem;
}
.kv-label { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.kv-value { display: block; font-size: 15px; font-weight: 600; margin-top: .15rem; }

/* ---------- Tablolar & metin sayfaları ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; margin: .5rem 0 1.2rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }

.page-narrow { max-width: 760px; margin: 0 auto; padding: 2rem 1.2rem 3rem; }
.prose h2 { margin-top: 1.8rem; font-size: 17px; }
.prose ul { padding-left: 1.1rem; }
.prose li { margin: .25rem 0; }

/* ---------- Şehir sayfaları (SEO açılışları) ---------- */

.page-wide { max-width: 1080px; margin: 0 auto; padding: 1.6rem 1.2rem 3rem; width: 100%; }
.page-wide h1 { font-size: 26px; margin-bottom: .6rem; }
.lead { font-size: 16px; color: var(--text-muted); max-width: 68ch; }
.lead strong { color: var(--text); }

.breadcrumb { font-size: 13px; color: var(--text-muted); display: flex; gap: .4rem; margin-bottom: .8rem; flex-wrap: wrap; }

.stat-row-wide { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 1.2rem 0; }

.city-map {
    height: 380px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin: 1.4rem 0;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .6rem;
    margin: 1.4rem 0;
}

.city-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .7rem .85rem;
    color: var(--text);
}
.city-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.city-name { display: block; font-weight: 600; font-size: 15px; }
.city-meta { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: .1rem; }

.city-empty-list { font-size: 13px; line-height: 1.7; }

.table-scroll { overflow-x: auto; }
.table-scroll .table { min-width: 620px; }
.table td .muted { display: block; font-size: 12px; }

.error-code { font-size: 54px; margin: 0; letter-spacing: -.03em; }
.error-lead { font-size: 17px; margin-top: 0; }

.notice {
    border-radius: var(--radius);
    padding: .8rem 1rem;
    font-size: 14px;
    margin-bottom: 1rem;
}
.notice-error { background: var(--danger-soft); border: 1px solid #f2c4bf; color: #7d251a; }
.notice-error p { margin: .4rem 0 0; }
.notice-success { background: var(--success-soft); border: 1px solid #b9dcc7; color: #10502f; }

.setup-notice { margin: 1rem 1.1rem; }

.trace { margin: 1rem 0; }
.trace summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }

/* ---------- İstasyon detay sayfası ---------- */

.station-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.6rem 1.2rem 3rem;
    width: 100%;
}

.back-link { font-size: 13px; color: var(--text-muted); }
.station-title { font-size: 24px; margin-top: .5rem; }
.station-sub { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 0; }

.section-heading { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-top: 1.8rem; }

.station-map {
    height: 240px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}
.station-coords { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.nearby-list { list-style: none; margin: 0; padding: 0; }
.nearby-list li { border-bottom: 1px solid var(--border); }
.nearby-list a { display: block; padding: .5rem 0; color: var(--text); }
.nearby-list a:hover { text-decoration: none; color: var(--accent); }
.nearby-name { display: block; font-size: 14px; }
.nearby-meta { display: block; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.report-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.report-row { display: grid; grid-template-columns: 1fr 120px auto; gap: .5rem; margin-bottom: .5rem; }
.form-feedback { font-size: 13px; margin: .6rem 0 0; min-height: 1.2em; }
.form-feedback.is-error { color: var(--danger); }
.form-feedback.is-success { color: var(--success); }

/* ---------- Duyarlılık ---------- */

@media (max-width: 900px) {
    .map-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--border); max-height: 45vh; }
    .map-area { min-height: 55vh; }
    .detail-panel { width: 100%; top: auto; height: 62vh; border-left: 0; border-top: 1px solid var(--border); }
    .station-page { grid-template-columns: 1fr; }
    .report-row { grid-template-columns: 1fr; }
}
