/* ===================================================
   ÖNCÜLER ATLASI — Türk Bayrağı Renk Paleti
   Kırmızı: #E30A17  |  Beyaz: #FAFAFA
   =================================================== */

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

:root {
    /* Ana renkler — Türk bayrağı */
    --kirmizi: #E30A17;
    --kirmizi-koyu: #B00810;
    --kirmizi-acik: #F5434F;
    --kirmizi-soluk: #FDE8E9;

    /* Nötr tonlar — BEYAZ TEMA */
    --bg: #f8f4f4;
    --surface: #ffffff;
    --surface2: #f2e8e8;
    --surface3: #e8d5d5;
    --border: rgba(227, 10, 23, .18);
    --border-bright: rgba(227, 10, 23, .4);

    /* Metin — koyu */
    --text: #1a0608;
    --text-muted: #6b2a30;
    --text-dim: #b07075;

    /* Vurgular */
    --accent: #E30A17;
    --accent-soft: rgba(227, 10, 23, .1);

    --sidebar-w: 440px;
    --transition: 0.38s cubic-bezier(.4, 0, .2, 1);
}

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

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* ── ATATÜRK SÖZU BANDI ──────────────────────────── */
#ataturk-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: linear-gradient(90deg, var(--kirmizi-koyu) 0%, var(--kirmizi) 50%, var(--kirmizi-koyu) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .15);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

#ataturk-banner .banner-text {
    font-family: 'Playfair Display', serif;
    font-size: 13.5px;
    font-style: italic;
    color: rgba(255, 255, 255, .95);
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.55;
}

#ataturk-banner .banner-source {
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    color: rgba(255, 255, 255, .65);
    letter-spacing: 1.5px;
    white-space: nowrap;
}

#ataturk-banner .star {
    color: rgba(255, 255, 255, .7);
    font-size: 18px;
    flex-shrink: 0;
}

/* ── ÜST BAR ─────────────────────────────────────── */
#topbar {
    display: none;
    /* Üst barı tamamen kaldırdım */
}

/* ── LAYOUT ─────────────────────────────────────── */
#app {
    display: flex;
    height: 100vh;
}

/* ── HARİTA ALANI ────────────────────────────────── */
#map-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px 40px;
    /* banner için üstten boşluk */
    transition: padding-right var(--transition);
    position: relative;
}

#map-container.sidebar-open {
    padding-right: calc(var(--sidebar-w) + 48px);
}

/* SVG harita */
.svg-turkiye-haritasi {
    width: 100%;
    max-width: 920px;
}

.svg-turkiye-haritasi svg {
    width: 100%;
    height: auto;
}

/* Normal halde kırmızı neon */
svg#svg-turkiye-haritasi {
    filter: drop-shadow(0 0 18px rgba(227, 10, 23, .55)) drop-shadow(0 0 40px rgba(227, 10, 23, .28));
    transition: filter 0.4s ease;
}

/* Hover'da daha güçlü kırmızı neon */
svg#svg-turkiye-haritasi.map-hovering {
    filter: drop-shadow(0 0 22px rgba(227, 10, 23, .75)) drop-shadow(0 0 55px rgba(227, 10, 23, .4));
}


/* Şehir stilleri — kırmızı */
#svg-turkiye-haritasi g path,
#svg-turkiye-haritasi g polygon {
    fill: #E30A17;
    stroke: #B00810;
    stroke-width: 0.8;
    cursor: pointer;
    transition: fill 0.22s ease, stroke 0.22s ease, opacity 0.22s ease;
}

/* Hover'da diğer şehirler solar */
#svg-turkiye-haritasi.map-hovering g path,
#svg-turkiye-haritasi.map-hovering g polygon {
    fill: #c0080f;
    stroke: #900008;
    opacity: 0.45;
}

/* Hover'daki şehir beyaz olur */
#svg-turkiye-haritasi g.city-hover path,
#svg-turkiye-haritasi g.city-hover polygon {
    fill: #ffffff !important;
    stroke: rgba(255, 255, 255, 0.9) !important;
    stroke-width: 1.2;
    opacity: 1 !important;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

/* Öncüsü olan şehir — daha koyu kırmızı */
#svg-turkiye-haritasi g.has-oncu path,
#svg-turkiye-haritasi g.has-oncu polygon {
    fill: #a0070e;
}

/* Öncülü şehir hover — beyaz */
#svg-turkiye-haritasi g.has-oncu.city-hover path,
#svg-turkiye-haritasi g.has-oncu.city-hover polygon {
    fill: #ffffff !important;
    stroke: rgba(255, 255, 255, 0.95) !important;
    stroke-width: 1.4;
    opacity: 1 !important;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.9));
}

/* Seçili şehir — parlak beyaz */
#svg-turkiye-haritasi g.active path,
#svg-turkiye-haritasi g.active polygon {
    fill: #ffffff !important;
    stroke: rgba(255, 255, 255, 0.9) !important;
    stroke-width: 1.6;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.85));
}

/* Tooltip */
#map-tooltip {
    position: fixed;
    background: rgba(255, 252, 252, .97);
    border: 1px solid var(--border-bright);
    color: var(--kirmizi);
    box-shadow: 0 2px 12px rgba(227, 10, 23, .15);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 100;
    backdrop-filter: blur(8px);
    letter-spacing: .3px;
}

/* ── SIDEBAR ─────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: rgba(255, 252, 252, .97);
    border-left: 1px solid var(--border-bright);
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
    z-index: 180;
    overflow: hidden;
}

#sidebar.open {
    transform: translateX(0);
    box-shadow: -8px 0 40px rgba(227, 10, 23, .15);
}

/* Kapat butonu */
#sidebar-close {
    position: fixed;
    top: 36px;
    right: 16px;
    background: rgba(15, 5, 7, .92);
    border: 1px solid var(--border-bright);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    z-index: 999;
}

#sidebar-close:hover {
    background: rgba(227, 10, 23, .25);
    border-color: var(--kirmizi);
    color: white;
}

/* Kırmızı dekoratif çizgi */
#sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--kirmizi-koyu), var(--kirmizi), var(--kirmizi-koyu));
}

/* Başlık */
#sidebar-header {
    padding: 28px 28px 18px;
    border-bottom: 1px solid var(--border);
    margin-top: 3px;
}

#sidebar-city {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--kirmizi);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#sidebar-city::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--kirmizi);
}

#sidebar-name {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

#sidebar-dates {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 300;
}

/* Galeri */
#gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface2);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    border: 1px solid var(--border);
}

.gallery-item:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(227, 10, 23, .3);
    border-color: var(--kirmizi);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 26px;
}

/* Bilgi bölümü */
#sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 28px 36px;
    scrollbar-width: thin;
    scrollbar-color: var(--surface3) transparent;
}

#sidebar-body::-webkit-scrollbar {
    width: 4px;
}

#sidebar-body::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 4px;
}

.info-block {
    margin-bottom: 24px;
}

.info-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--kirmizi);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Alanlar */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag {
    display: inline-block;
    padding: 5px 13px;
    background: rgba(227, 10, 23, .1);
    border: 1px solid rgba(227, 10, 23, .25);
    border-radius: 20px;
    font-size: 12px;
    color: var(--kirmizi-acik);
    font-weight: 500;
    letter-spacing: .3px;
}

/* Biyografi */
.biography {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-muted);
}

/* Yükleniyor */
#sidebar-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--surface3);
    border-top-color: var(--kirmizi);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Boş durum */
#sidebar-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 50px 28px;
    color: var(--text-muted);
    font-size: 14px;
    gap: 12px;
    line-height: 1.6;
}

#sidebar-empty .icon {
    font-size: 44px;
    opacity: .35;
}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .93);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

#lightbox.active {
    display: flex;
}

#lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(227, 10, 23, .2);
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 30px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: color .2s;
    line-height: 1;
}

#lightbox-close:hover {
    color: white;
}

/* ── ADMIN PANELİ ────────────────────────────────── */
.admin-wrap {
    max-width: 980px;
    margin: 40px auto;
    padding: 0 24px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
}

.admin-wrap h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--kirmizi-acik);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.admin-table th {
    padding: 14px 18px;
    text-align: left;
    background: var(--surface2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--kirmizi);
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--surface2);
}

.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all .2s;
}

.btn-primary {
    background: var(--kirmizi);
    color: white;
}

.btn-primary:hover {
    background: var(--kirmizi-acik);
}

.btn-danger {
    background: rgba(227, 10, 23, .1);
    color: #ff6b6b;
    border: 1px solid rgba(227, 10, 23, .3);
}

.btn-danger:hover {
    background: rgba(227, 10, 23, .2);
}

.btn-ghost {
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--kirmizi);
}

/* Formlar */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px;
    max-width: 720px;
}

.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--kirmizi);
    margin-bottom: 9px;
}

input[type=text],
input[type=date],
input[type=file],
select,
textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    padding: 11px 15px;
    outline: none;
    transition: border-color .2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--kirmizi);
    box-shadow: 0 0 0 3px rgba(227, 10, 23, .1);
}

textarea {
    resize: vertical;
    min-height: 130px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.alert {
    padding: 13px 18px;
    border-radius: 9px;
    font-size: 14px;
    margin-bottom: 22px;
}

.alert-success {
    background: rgba(34, 197, 94, .1);
    border: 1px solid rgba(34, 197, 94, .25);
    color: #4ade80;
}

.alert-error {
    background: rgba(227, 10, 23, .1);
    border: 1px solid rgba(227, 10, 23, .3);
    color: #ff6b6b;
}

/* Fotoğraf önizleme */
.photo-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.photo-cell {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.photo-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 28px;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 100vw;
    }

    #sidebar {
        z-index: 250;
        /* Header'ların üstünü örtmesi için */
    }

    #sidebar-header {
        padding-top: 56px;
        /* Kapatma tuşuna yer açmak için */
    }

    #sidebar-close {
        top: 16px;
        right: 16px;
        background: rgba(15, 5, 7, .98);
        box-shadow: 0 4px 12px rgba(227, 10, 23, .2);
    }

    #map-container.sidebar-open {
        padding-right: 48px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    #ataturk-banner {
        padding: 8px 12px;
        gap: 8px;
    }

    #ataturk-banner .banner-text {
        font-size: 11px;
    }

    /* Topbar kalktığı için map-container boşluğunu azalttım */
    #map-container {
        padding-top: 50px;
    }

    .welcome-text {
        padding: 20px;
        font-size: 13.5px;
    }

    .welcome-text h2 {
        font-size: 20px;
    }
}

/* ── WELCOME MODAL ───────────────────────────────── */
.welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome-modal.active {
    opacity: 1;
    visibility: visible;
}

.welcome-modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 16px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(227, 10, 23, 0.15);
    border: 1px solid var(--border-bright);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.welcome-modal.active .welcome-modal-content {
    transform: translateY(0);
}

#welcome-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(15, 5, 7, 0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s;
}

#welcome-close:hover {
    background: var(--kirmizi);
}

.welcome-img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-bottom: 2px solid var(--kirmizi);
}

.welcome-text {
    padding: 32px;
    color: var(--text);
    line-height: 1.7;
    font-size: 14.5px;
}

.welcome-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: var(--kirmizi-koyu);
    margin-bottom: 20px;
    text-align: center;
}

.welcome-text p {
    margin-bottom: 16px;
}

.welcome-text .signature {
    text-align: right;
    font-weight: 600;
    color: var(--kirmizi);
    margin-top: 24px;
    font-style: italic;
}