/* ===================================================
   BASE RESET & VARIABLES
=================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:        #0a0f1a;
  --bg-panel:       rgba(17, 24, 39, 0.97);
  --bg-card:        #1a2235;
  --border:         #1f2d42;
  --accent:         #34d399;
  --gold:           #fbbf24;
  --text-primary:   #f1f5f9;
  --text-muted:     #64748b;
  --header-h:       44px;
  --content-h:      168px;   /* kart galerisi sabit yüksekliği  */
  --peek-h:         78px;    /* handle(20) + tab-bar(58)        */
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===================================================
   APP SHELL — harita tam ekran, panel üste yüzer
=================================================== */
#app {
  position: relative;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

/* ── MAP SECTION (tüm ekran) ── */
#map-section {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#map-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 900;
  height: var(--header-h);
  background: linear-gradient(180deg, rgba(10,15,26,.95) 0%, rgba(10,15,26,.0) 100%);
  display: flex;
  align-items: center;
  padding: 0 14px;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #fff;
}

.header-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ===================================================
   LEAFLET CUSTOM MARKER
=================================================== */
.custom-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.6));
  transition: transform .15s ease;
}
.custom-pin:active { transform: scale(.9); }

/* SVG pin — eski .pin-bubble artık kullanılmıyor */
.svg-pin svg {
  display: block;
  transition: transform .15s ease;
}
.svg-pin:hover svg { transform: scale(1.12); }

.pin-label {
  margin-top: 3px;
  background: rgba(10,15,26,.88);
  color: #fff;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.15);
  pointer-events: none;
}

/* ===================================================
   AÇILIŞ SPLASH
=================================================== */
#splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayIn .3s ease forwards;
}
#splash-overlay.hidden { display: none; }

#splash-img {
  max-height: 80vh;
  width: auto;
  max-width: 92vw;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
}

#splash-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background .15s, transform .15s;
  z-index: 10000;
}
#splash-close:hover {
  background: rgba(255,255,255,.28);
  transform: scale(1.08);
}

/* ===================================================
   BOTTOM PANEL — FLOATING BOTTOM SHEET
=================================================== */
#bottom-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Animasyon */
  transition: transform 0.32s cubic-bezier(.4, 0, .2, 1);
}

/* PEEK modu: kartlar ekran dışı, sadece handle+sekmeler görünür */
#bottom-panel.sheet-collapsed {
  transform: translateY(var(--content-h));
}

/* TAM AÇIK mod */
#bottom-panel.sheet-expanded {
  transform: translateY(0);
}

/* ── DRAG HANDLE ── */
#drag-handle {
  flex-shrink: 0;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
#drag-bar {
  width: 40px;
  height: 4px;
  background: #2d3f57;
  border-radius: 4px;
  transition: background .2s;
}
#drag-handle:hover #drag-bar,
#drag-handle:active #drag-bar { background: #4b6280; }

.panel-header,
.panel-title-row,
.scroll-hint { display: none; }

/* ── SEKME ÇUBUĞU ── */
.tab-bar {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 7px 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.tab-btn:hover { background: #1e2d44; color: var(--text-primary); }
.tab-btn.tab-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── PLACEHOLDER ── */
#gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 100%;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: .04em;
  pointer-events: none;
  user-select: none;
}

/* ── HORIZONTAL SCROLL TRACK ── */
#cultural-scroll {
  flex-shrink: 0;
  height: var(--content-h);
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
#cultural-scroll::-webkit-scrollbar { display: none; }

/* ── CULTURAL CARD ── */
.cultural-card {
  flex-shrink: 0;
  scroll-snap-align: start;
  width: 110px;
  height: calc(100% - 4px);
  min-height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
  position: relative;
}
.cultural-card:hover {
  border-color: rgba(251,191,36,.5);
  transform: translateY(-2px);
}
.cultural-card:active { transform: scale(.96); }

.card-thumb {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: #060d18;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Plaj kartı — emoji placeholder */
.card-emoji-wrap {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1f3a 0%, #0c3460 100%);
  border-radius: 12px 12px 0 0;
}
.card-big-emoji {
  font-size: 32px;
  line-height: 1;
}

.card-label {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: .03em;
  padding: 5px 6px 6px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.card-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 14px; height: 14px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-badge svg { width: 9px; height: 9px; fill: #0a0f1a; }

/* ===================================================
   MODAL OVERLAY
=================================================== */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 10, 20, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: overlayIn .2s ease forwards;
}
#modal-overlay.hidden { display: none; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── MODAL BOX ── */
#modal-box {
  background: #111827;
  border: 1px solid #1f3050;
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  padding: 18px 16px 20px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
  animation: boxIn .25s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes boxIn {
  from { opacity: 0; transform: scale(.88) translateY(18px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

/* Close button */
#modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #1f2d42;
  border: 1px solid #2a3f5a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  transition: background .15s, color .15s;
  z-index: 10;
}
#modal-close:hover { background: #2d3f57; color: #f1f5f9; }

/* Title */
#modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-right: 40px;
  letter-spacing: .04em;
  color: #f1f5f9;
}

/* Image */
#modal-img-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #060d18;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-img {
  width: 100%;
  max-height: 70vh;
  height: auto;
  object-fit: contain;
  display: block;
  background: #060d18;
}

/* Plaj modal — büyük emoji alanı */
#modal-emoji {
  display: none;
  width: 100%;
  height: 210px;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  background: linear-gradient(135deg, #0a1f3a 0%, #0c3460 100%);
  border-radius: 12px;
}

/* Nav Button */
#modal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #059669 0%, #34d399 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(52,211,153,.3);
  transition: opacity .15s, transform .15s;
}
#modal-nav-btn:hover  { opacity: .9; }
#modal-nav-btn:active { transform: scale(.97); }

/* ===================================================
   LEAFLET OVERRIDES
=================================================== */
.leaflet-control-zoom {
  border: none !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.4) !important;
}
.leaflet-control-zoom a {
  background: #111827 !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid #1f2d42 !important;
}
.leaflet-control-zoom a:hover {
  background: #1a2235 !important;
  color: #f1f5f9 !important;
}
.leaflet-control-attribution {
  background: rgba(10,15,26,.7) !important;
  color: #475569 !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: #64748b !important; }

/* ===================================================
   GELİŞTİRİCİ ÇIKTI PANELİ
=================================================== */
#dev-panel {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 950;
  width: 260px;
  background: rgba(10, 15, 26, 0.93);
  border: 1px solid #1f3050;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.6);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dev-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: #111827;
  border-bottom: 1px solid #1f3050;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: .05em;
}
.dev-panel-header button {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.dev-panel-header button:hover { color: #f1f5f9; background: #1f2d42; }

#dev-output {
  width: 100%;
  height: 90px;
  background: #0a0f1a;
  color: #34d399;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 10px;
  line-height: 1.5;
  padding: 8px 10px;
  border: none;
  resize: none;
  outline: none;
}
#dev-output::placeholder { color: #2d3f57; }

#dev-copy-btn {
  width: 100%;
  padding: 7px;
  background: #059669;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  letter-spacing: .06em;
  transition: background .15s;
}
#dev-copy-btn:hover { background: #047857; }

/* ===================================================
   EDİTÖR POPUP (Leaflet)
=================================================== */
.editor-lf-popup .leaflet-popup-content-wrapper {
  background: #111827;
  border: 1px solid #1f3050;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  padding: 0;
}
.editor-lf-popup .leaflet-popup-content {
  margin: 0;
  width: 230px !important;
}
.editor-lf-popup .leaflet-popup-tip {
  background: #111827;
}

.editor-popup {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
}
.ep-coords {
  font-size: 10px;
  color: #34d399;
  font-family: monospace;
  margin: 0;
  letter-spacing: .04em;
}
.ep-input,
.ep-select {
  width: 100%;
  background: #0a0f1a;
  border: 1px solid #1f3050;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 12px;
  padding: 7px 9px;
  outline: none;
  transition: border-color .15s;
}
.ep-input:focus,
.ep-select:focus { border-color: #34d399; }
.ep-select option { background: #111827; }

.ep-btn {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: .05em;
  transition: opacity .15s;
}
.ep-btn:hover { opacity: .88; }

