/* =========================================================
   GENEL RESET & DEĞİŞKENLER
========================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root { 
    --bg: #050a18; 
    --surface: rgba(255,255,255,0.05); 
    --border: rgba(255,255,255,0.1); 
    --accent: #C2A86B;
    --accent-blue: #3b9eff;
    --accent2: #00d4aa; 
    --text: #d4e4f5; 
    --muted: #64748b; 
    --panel-w: 400px; 
}

/* Light mod */
body.light { 
    --bg: #f5f0e8; 
    --surface: #fdfaf5; 
    --border: #d6c9a8; 
    --text: #1c1610; 
    --muted: #7a6f5a; 
    --accent: #7a5c00; 
    --accent-blue: #1d4ed8;
    --accent2: #15803d; 
}

body { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    color: var(--text); 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s; 
}

/* =========================================================
   HEADER, ARAMA & LEJANT
========================================================= */
header { 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 12px 28px; background: var(--surface); 
    backdrop-filter: blur(15px); border-bottom: 1px solid var(--border); 
    z-index: 9999; gap: 16px; position: relative; 
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s;
}
header h1 { 
    font-size: 1.2rem; font-weight: 800; color: var(--accent); 
    letter-spacing: 0.5px; cursor: pointer; text-transform: uppercase; 
    transition: opacity 0.2s;
}
header h1:hover { opacity: 0.8; }

.header-controls { display: flex; align-items: center; gap: 15px; }

.search-wrap { position: relative; flex-shrink: 0; }
.search-wrap input { 
    background: var(--surface); border: 1px solid var(--border); 
    color: var(--text); padding: 10px 15px 10px 35px; border-radius: 20px; 
    font-size: 0.85rem; width: 240px; outline: none; transition: 0.3s; 
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(194, 168, 107, 0.15); }
.search-wrap input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.9rem; pointer-events: none; }

.search-results { 
    position: absolute; top: calc(100% + 10px); left: 0; right: 0; 
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px; 
    display: none; box-shadow: 0 20px 40px rgba(0,0,0,0.6); max-height: 50vh; overflow-y: auto; z-index: 10000;
}
body.light .search-results { box-shadow: 0 15px 30px rgba(0,0,0,0.15); }
.search-results::-webkit-scrollbar { width: 5px; }
.search-results::-webkit-scrollbar-thumb { background: rgba(194,168,107,.4); border-radius: 10px; }

.search-result-item { padding: 10px 14px; font-size: 0.85rem; cursor: pointer; transition: background .15s; border-bottom: 1px solid var(--border); }
.search-result-item:hover, .search-result-item.active-search { background: rgba(194, 168, 107, 0.15); }
.search-result-item .sub { font-size: 0.73rem; color: var(--muted); margin-top: 3px; }

.legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); cursor: pointer; padding: 4px 10px; border-radius: 20px; transition: all .2s; }
.legend-item:hover { background: var(--surface); color: var(--text); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }


/* =========================================================
   ANA YAPI & HARİTA
========================================================= */
.main { display: flex; flex: 1; overflow: hidden; position: relative; z-index: 1; }
.map-wrap { 
    flex: 1; display: flex; align-items: center; justify-content: center; 
    padding: 20px; position: relative; background: transparent; 
}
.map-wrap::before {
    content: ''; position: absolute; width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(194, 168, 107, 0.08) 0%, transparent 70%);
    z-index: -1; pointer-events: none;
}

/* =========================================================
   HARİTA (Dev Ekranlara Yayılma ve Renklenme Hızı)
========================================================= */
#map { 
    width: 100%;       /* Ekranda boşluk kalmaz, tamamen yayılır */
    height: 100%; 
    max-height: 85vh;  /* Navbar'a değmemesi için maksimum yükseklik */
    filter: drop-shadow(0 25px 50px rgba(0,0,0,0.6)); 
    z-index: 2; 
    position: relative; 
    
    /* Bir ile tıkladığındaki renk değişimi ve yakınlaşmaların yavaşlığı */
    transition: filter 0.4s, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
}

body.light #map { 
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.15)); 
}

#map text { 
    fill: #2c1e0d !important; 
    font-size: 16px; 
    font-weight: 700; 
    pointer-events: none; 
    user-select: none; 
}

.Welayat { cursor: pointer; }
.Welayat .etrap { 
    fill: #e5d39c !important; stroke: #8a5e00 !important; stroke-width: 5px !important;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}
.Welayat:hover .etrap { fill: #f8e8a4 !important; stroke: #5c3a00 !important; stroke-width: 2px !important; }
.Welayat.selected .etrap { 
    fill: #f8e8a4 !important; stroke: #5c3a00 !important; stroke-width: 2px !important; 
    stroke-dasharray: 10 5; animation: borderAnim 2s linear infinite; 
}
.etrap-highlight { fill: #00ff2f !important; stroke: #5c3a00 !important; stroke-width: 2px !important; }
@keyframes borderAnim { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -30; } }

.tkm-border { fill: none; stroke: rgba(130,90,0,0.35); stroke-width: 2; }
.borders { fill: none; stroke: rgba(90,60,0,0.2); pointer-events: none; }
body.light .tkm-border { stroke: rgba(90,60,0,0.3); }
body.light .borders { stroke: rgba(0,0,0,0.18) !important; }



/* =========================================================
   SAĞ PANEL (Haritayı Yumuşakça İter)
========================================================= */
.panel { 
    width: 0;          /* Başlangıçta 0 genişlik, haritayı itmez */
    min-width: 0;
    opacity: 0;
    overflow: hidden;  /* İçindeki yazılar daralırken dışarı taşmasın */
    background: var(--surface); 
    backdrop-filter: blur(25px); 
    border-left: 1px solid var(--border); 
    display: none; 
    flex-direction: column; 
    box-shadow: -10px 0 30px rgba(0,0,0,0.05); 
    z-index: 5;
    
    /* GÖZ ALICI YAVAŞLIK: Genişlik ve görünürlük 0.6 saniyede usulca değişir */
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                min-width 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.5s ease;
}

.panel.active-panel { 
    display: flex;
    width: var(--panel-w); 
    min-width: var(--panel-w);
    opacity: 1;
}

/* Sinematik Moda Geçildiğinde Panel Yavaşça Küçülerek Haritayı Ortalar */
body.cinematic-mode .panel { 
    width: 0 !important; 
    min-width: 0 !important; 
    opacity: 0 !important; 
    pointer-events: none; 
}

.panel-inner { flex: 1; overflow-y: auto; padding: 25px; scroll-behavior: smooth; }
.panel-inner::-webkit-scrollbar { width: 6px; }
.panel-inner::-webkit-scrollbar-track { background: transparent; }
.panel-inner::-webkit-scrollbar-thumb { background: rgba(194, 168, 107, 0.4); border-radius: 10px; }

/* Panel İçi Bileşenler */
.modern-tabs {
    display: flex; gap: 5px; background: rgba(0,0,0,0.2); 
    padding: 5px; border-radius: 50px; margin-bottom: 25px; border: 1px solid var(--border);
}
body.light .modern-tabs { background: #ede8df; }
.m-tab {
    flex: 1; padding: 10px; border-radius: 40px; border: none; 
    background: transparent; color: var(--muted); font-weight: 700; 
    font-size: 0.75rem; cursor: pointer; transition: 0.3s;
}
.m-tab.active-tab { background: var(--accent); color: #fff; box-shadow: 0 4px 15px rgba(194, 168, 107, 0.3); }

.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 14px; padding: 40px 20px; }
.welcome-icon { font-size: 4rem; color: var(--accent); }
.welcome h2 { font-size: 1.2rem; color: var(--text); font-weight: 600; }
.welcome p { font-size: 0.9rem; line-height: 1.6; }

.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb .crumb { cursor: pointer; transition: color .15s; }
.breadcrumb .crumb:hover { color: var(--accent); }
.breadcrumb .crumb.current { color: var(--text); font-weight: 600; }

.v-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.v-color { width: 16px; height: 16px; border-radius: 4px; box-shadow: 0 0 10px currentColor; }
.v-title { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.v-desc { font-size: .9rem; color: var(--muted); line-height: 1.7; margin-bottom: 20px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 25px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px; transition: 0.3s; }
.stat:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.stat-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 1rem; font-weight: 600; color: var(--text); }

.section-head { font-size: .8rem; color: var(--muted); text-transform: uppercase; margin-bottom: 15px; display: flex; justify-content: space-between; }
.etrap-list { display: flex; flex-direction: column; gap: 10px; }
.etrap-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: space-between; }
.etrap-card:hover { border-color: var(--accent); transform: translateX(4px); background: rgba(194, 168, 107, 0.05); }
.etrap-card.active { border-color: var(--accent); background: rgba(194, 168, 107, 0.15); }
.etrap-card-name { font-size: .95rem; font-weight: 600; color: var(--text); }
.etrap-card-pop { font-size: .78rem; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; }
.etrap-arrow { color: var(--accent); font-size: 1rem; opacity: 0; transition: 0.2s; }
.etrap-card:hover .etrap-arrow { opacity: 1; transform: translateX(3px); }

.divider { height: 1px; background: var(--border); margin: 20px 0; }
.section-count { background: var(--accent); color: #000; font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.etrap-detail { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.etrap-detail-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 15px; }

.mini-bar {
    padding: 12px 25px; background: var(--surface); border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); gap: 10px;
}
.mini-bar span { color: var(--text); font-weight: 600; }


/* =========================================================
   TURİZM FOTOĞRAFLARI (Yavaşlatıldı)
========================================================= */
#tourismPhotos { 
    position: absolute; top: 20px; right: 20px; 
    display: none; /* Başlangıçta gizli */
    grid-template-columns: 1fr 1fr; gap: 12px; 
    z-index: 100; pointer-events: none; 
    
    /* Panel ile uyumlu yavaşlık */
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); 
}

#tourismPhotos.active-panel { 
    display: grid; 
    opacity: 1;
    transform: translateX(0);
}

.tour-photo { 
    pointer-events: auto; width: 90px; height: 65px; 
    border-radius: 10px; border: 2px solid rgba(255,255,255,0.8); 
    overflow: hidden; cursor: pointer; 
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 8px 20px rgba(0,0,0,0.3); 
}
.tour-photo:hover { transform: scale(1.15) rotate(2deg); border-color: var(--accent); z-index: 10; }
.tour-photo img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   SİNEMATİK MODDA FOTOĞRAFLAR (AKILLI HİZALAMA)
========================================================= */
body.cinematic-mode #tourismPhotos {
    /* Yukarıdaki boşluğu sildik, tavana yaklaştırdık */
    top: 15px; 
    right: 20px; 
    
    /* Sabit genişliği iptal ettik, otomatik yayılacak */
    width: auto; 
    
    /* Akıllı Sıralama Mantığı: */
    display: flex; 
    flex-direction: column; /* Fotoğrafları yukarıdan aşağı diz */
    flex-wrap: wrap;        /* Yere sığmazsa yana (sola) yeni sütun aç */
    align-content: flex-end; /* Sütunları en sağa daya */
    gap: 12px;
    
    /* HARİTAYA DEĞMEMESİ İÇİN KRİTİK KOD: 
       Fotoğraflar ekranın %65'inden daha aşağı inemez. 
       Aşağı inemediği için otomatik olarak haritanın üstündeki boşluğa kayar. */
    max-height: 65vh; 
}

body.cinematic-mode .tour-photo { 
    width: 140px;  /* Haritayı boğmaması için bir tık kibarlaştırıldı */
    height: 95px; 
    border-width: 3px; 
    border-radius: 12px; 
}

/* =========================================================
   TAM EKRAN BUTONU VE ZOOMLAR
========================================================= */
.zoom-controls { position: absolute; bottom: 90px; left: 34px; display: flex; flex-direction: column; gap: 10px; z-index: 10; transition: opacity 0.5s; }
.zoom-btn { 
    width: 42px; height: 42px; background: var(--surface); 
    border: 1px solid var(--border); border-radius: 12px; 
    color: var(--text); cursor: pointer; font-size: 1.2rem; 
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px);
    transition: all .2s; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.05); }

.cinematic-btn {
    position: fixed; bottom: 30px; left: 30px; z-index: 100000;
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px);
}
.cinematic-btn:hover { background: var(--accent); color: #000; transform: scale(1.1); }
body.cinematic-mode .cinematic-btn .menu-icon { display: none; }
body.cinematic-mode .cinematic-btn .close-icon { display: block !important; }

body.cinematic-mode header { transform: translateY(-100%); opacity: 0; pointer-events: none; }
body.cinematic-mode .zoom-controls { opacity: 0; pointer-events: none; }

/* =========================================================
   MODAL (ÖN İZLEME VE GENİŞLETİLMİŞ) - TAMAMI GÜNCELLENDİ
========================================================= */

/* Ana Arka Plan */
.photo-viewer { 
    position: fixed; inset: 0; 
    background: rgba(0,0,0,0.9); 
    backdrop-filter: blur(15px); 
    display: none; 
    align-items: center; 
    justify-content: center; 
    z-index: 100000; 
    padding: 20px; 
    animation: fadeIn 0.4s ease;
}

/* Modal Kutusu */
.photo-modal { 
    width: 950px; 
    max-width: 95%; 
    background: var(--bg); 
    color: var(--text);
    border-radius: 20px; 
    position: relative; 
    border: 1px solid var(--border); 
    box-shadow: 0 40px 80px rgba(0,0,0,0.6); 
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; /* Küçük görünümde resmin taşmasını engeller */
}

/* Kapatma Butonu (Akıllı Buton) */
.close-modal-btn {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: var(--surface);
    border: 1px solid var(--border); 
    color: var(--text); 
    width: 45px; 
    height: 45px;
    border-radius: 50%; 
    font-size: 1.8rem; 
    cursor: pointer; 
    z-index: 100001; /* Her şeyin üstünde */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: 0.3s;
    outline: none;
}

.close-modal-btn:hover {
    background: var(--accent);
    color: #000;
    transform: rotate(90deg) scale(1.1);
}

/* Genişletildiğinde Butonun Takip Etmesi İçin */
.photo-modal.expanded .close-modal-btn {
    position: fixed; /* Sayfa kaydıkça seninle gelir */
    top: 30px;
    right: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

/* Küçük Modal Modu (Preview) - Resim ve Metin Yan Yana */
.preview-mode {
    display: flex; 
    width: 100%;
    height: 500px; /* Sabit yükseklik küçük modda daha düzgün durur */
}

.photo-left { 
    width: 50%; 
    height: 100%;
}

.photo-left img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* Resmi bozmadan doldurur */
    display: block; 
}

.photo-right { 
    width: 50%; 
    padding: 40px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.photo-right h2 { 
    color: var(--accent); 
    margin-bottom: 15px; 
    font-size: 1.8rem; 
    padding-right: 30px; /* Butona çarpmaması için */
}

.photo-right p#viewerDesc {
    color: var(--muted); 
    line-height: 1.6; 
    font-size: 0.95rem; 
    margin-bottom: 20px;
    display: -webkit-box; 
    -webkit-line-clamp: 4; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
}

/* Genişletilmiş Modal Modu (Full) */
.photo-modal.expanded { 
    width: 98vw !important; 
    height: 96vh !important; 
    max-width: 1500px; 
    overflow-y: auto; 
    padding: 60px 50px; 
    display: block; /* Flex'i iptal eder */
}

.full-mode .page-title {
    font-family: 'Cinzel', serif; 
    font-size: 4.5rem; 
    font-weight: 800;
    line-height: 1.1; 
    color: var(--accent); 
    text-transform: uppercase; 
    margin: 20px 0 40px 0;
}

.gallery-wrapper { 
    float: left; 
    width: 45%; 
    margin: 0 30px 20px 0; 
    column-count: 2; 
    column-gap: 15px; 
}

.gallery-wrapper:has(.grid-card:only-child) { 
    column-count: 1; 
    width: 40%; 
}

.grid-card { 
    display: inline-block; 
    width: 100%; 
    margin-bottom: 15px; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
}

.grid-card img { 
    width: 100%; 
    display: block; 
    transition: 0.5s;
}

.grid-card:hover img {
    transform: scale(1.05);
}

.desc-text {
    font-size: 1.3rem; 
    line-height: 1.8; 
    color: var(--text);
    text-align: justify;
}

.desc-text::first-letter { 
    font-size: 5.5rem; 
    float: left; 
    margin-right: 15px; 
    color: var(--accent); 
    font-weight: 800; 
    line-height: 0.8; 
}

/* Buton Efekti */
.btn-read-more {
    padding: 12px 25px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    align-self: flex-start;
    transition: 0.3s;
}

.btn-read-more:hover {
    transform: translateX(10px);
    box-shadow: 0 0 20px var(--accent);
}
/* =========================================================
   TOOLTIP & ANİMASYONLAR
========================================================= */
.tooltip { 
    position: fixed; background: rgba(5,10,24,.95); border: 1px solid var(--accent); 
    border-radius: 8px; padding: 8px 14px; pointer-events: none; font-size: .85rem; 
    color: var(--accent); font-weight: 600; z-index: 2000; display: none; 
    backdrop-filter: blur(8px); white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.4); 
}
body.light .tooltip { background: #fdfaf5; border-color: #7a5c00; color: #1c1610; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }

/* =========================================================
   MOBİL UYUM
========================================================= */
@media (max-width: 1000px) {
    .main { flex-direction: column; }
    .panel { width: 100%; height: 45vh; border-left: none; border-top: 1px solid var(--border); }
    header { flex-wrap: wrap; justify-content: center; }
    .legend { display: none; }
    .header-controls { width: 100%; justify-content: center; }
    .search-wrap input { width: 100%; min-width: 250px; }
    .photo-modal { flex-direction: column; max-height: 90vh; overflow-y: auto; }
    .photo-left { width: 100%; height: 250px; }
    .photo-right { width: 100%; padding: 25px; }
    #tourismPhotos { top: 10px; right: 10px; gap: 8px; }
    .tour-photo { width: 50px; height: 35px; border-width: 1px; }
    .gallery-wrapper { float: none; width: 100%; column-count: 1; }
    .full-mode .page-title { font-size: 2.5rem; }
}


/* =========================================================
   AKILLI TV VE DEV EKRAN OPTİMİZASYONU (1800px ve üstü)
========================================================= */
@media (min-width: 1800px) {
    :root { 
        --panel-w: 500px; /* Panel 400'den 500'e çıkar, incecik görünmez */
    }
    
    /* Sinematik fotoğraflar TV'de çok daha görkemli büyük durur */
    body.cinematic-mode .tour-photo { 
        width: 190px; 
        height: 130px; 
        border-width: 4px;
        border-radius: 16px;
    }
    
    /* Yazı boyutları dev ekrana uyum sağlar */
    .v-title { font-size: 2rem; }
    .v-desc { font-size: 1.1rem; line-height: 1.8; }
    .stat-value { font-size: 1.2rem; }
}

/* =========================================================
   ÜST MENÜ BUTONLARI (FontAwesome Uyumlu)
========================================================= */
#adminBtn, #fullscreenBtn, #themeBtn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* İkon ile yazı arasındaki boşluk */
    text-decoration: none;
    outline: none;
}

#adminBtn:hover, #fullscreenBtn:hover, #themeBtn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}