/* =========================================================
   PEYNİR ATLASI — UYGULAMA STİLLERİ
   ========================================================= */

:root {
  --bg: #F5F5F5;
  --mint: #ffd5004f;
  --teal: #FFD400;
  --accent: #FF8C00;
  --ink: #1a1a1a;
  --muted: #6b7280;
}

* { -webkit-font-smoothing: antialiased; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

* {
  -webkit-user-drag: none;
}

img, svg, video, iframe {
  -webkit-user-drag: none;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}

.text-muted    { color: var(--muted); }
.bg-mint       { background: var(--mint); }
.bg-teal       { background: var(--teal); }
.bg-accent     { background: var(--accent); }
.text-accent   { color: var(--accent); }
.border-ink    { border-color: var(--ink); }

/* ---------- Türkiye Haritası ---------- */
@keyframes mapEnter {
  from { opacity: 0; transform: scale(0.94) translateY(10px); filter: blur(2px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    filter: blur(0);   }
}

.tr-map {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  animation: mapEnter 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
}

#mapWrap {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

#mapWrap svg.tr-map {
  width: auto;
  height: auto;
  max-width: 85%;
  max-height: 85%;
  display: block;
}

.map-info-panel {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 999px;
  border: 1px solid #E5E7EB;
  background: white;
  color: var(--ink);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.legend-toggle:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.info-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.legend-popup {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.75rem);
  width: min(22rem, calc(100vw - 2rem));
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.09);
  padding: 1rem;
}

.legend-popup.hidden {
  display: none;
}

.legend-popup p,
.legend-popup span {
  color: var(--ink);
}

@media (max-width: 767px) {
  .map-info-panel {
    left: auto;
    right: 1rem;
    top: 1rem;
    bottom: auto;
  }

  .legend-popup {
    left: auto;
    right: 0;
    bottom: auto;
    top: calc(100% + 0.75rem);
  }
}

.tr-map path {
  fill: var(--mint);
  stroke: #ffffff;
  stroke-width: 0.6;
  transition: fill 0.22s ease, filter 0.22s ease;
  cursor: default;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@keyframes cheeseAppear {
  from { opacity: 0.25; }
  to   { opacity: 1; }
}

.tr-map path.has-cheese {
  fill: var(--teal);
  cursor: pointer;
  animation: cheeseAppear 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  touch-action: manipulation;
}

.tr-map path.has-cheese:active {
  fill: var(--accent);
  filter: drop-shadow(0 2px 10px rgba(255, 140, 0, 0.5));
}

.tr-map path.has-cheese:hover {
  fill: var(--accent);
  filter: drop-shadow(0 2px 10px rgba(255, 140, 0, 0.5));
}

@keyframes citySelectedPulse {
  0%   { filter: drop-shadow(0 0 0px  transparent); }
  15%  { filter: drop-shadow(0 0 20px rgba(255, 140, 0, 0.95)); }
  45%  { filter: drop-shadow(0 0 6px  rgba(255, 140, 0, 0.5)); }
  72%  { filter: drop-shadow(0 0 14px rgba(255, 140, 0, 0.78)); }
  100% { filter: drop-shadow(0 0 6px  rgba(255, 140, 0, 0.5)); }
}

.tr-map path.selected {
  fill: var(--accent);
  animation: citySelectedPulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* ---------- Yan Panel ---------- */
.side-panel {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  max-width: 24rem;
  height: 100%;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 20;
}

.side-panel.hidden-panel {
  transform: translateX(-100%);
}

.side-panel:not(.hidden-panel) {
  transform: translateX(0);
}

main {
  min-width: 0;
  min-height: 0;
  transition: margin-left 0.35s cubic-bezier(0.22, 1, 0.36, 1), width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
  body.menu-open main {
    margin-left: 24rem;
    width: calc(100% - 24rem);
  }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  background: rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#modalContent {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#modalContent::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.modal-image-card {
  position: relative;
}

.modal-image-card .image-zoom-button {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.modal-image-card .image-zoom-button:hover {
  transform: translateY(-1px);
  background: white;
}

.modal-image-card img.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-anim { animation: modalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- Peynir liste itemları ---------- */
@keyframes itemSlideIn {
  from { opacity: 0; transform: translateX(-12px) translateY(3px); }
  to   { opacity: 1; transform: translateX(0)     translateY(0); }
}

.cheese-item {
  background: white;
  border: 1px solid #e9e9e9;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  animation: itemSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cheese-item:hover {
  border-color: var(--ink);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* ---------- Şehir adı & sayaç animasyonları ---------- */
@keyframes cityNameIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes countPopIn {
  from { opacity: 0; transform: scale(0.75); }
  60%  { transform: scale(1.08); }
  to   { opacity: 1; transform: scale(1); }
}

#cityName.anim-city {
  animation: cityNameIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#cheeseCount.anim-count {
  animation: countPopIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- Coğrafi işaret rozeti ---------- */
.geo-badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* ---------- Scrollbar ---------- */
.nice-scroll {
  scroll-behavior: smooth;
}

.nice-scroll::-webkit-scrollbar { width: 6px; }
.nice-scroll::-webkit-scrollbar-track { background: transparent; }
.nice-scroll::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 3px; }

/* ---------- Dekoratif arka plan ---------- */
.dotgrid {
  background-color: #edf1f8;
  background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  position: relative;
}

@keyframes bgGlow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

.dotgrid::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 60% at 55% 48%,
    rgba(255, 212, 0, 0.09) 0%,
    rgba(255, 160, 0, 0.04) 40%,
    transparent 72%);
  pointer-events: none;
  animation: bgGlow 7s ease-in-out infinite;
  z-index: 0;
}

.dotgrid::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,  rgba(0,0,0,0.04) 0%, transparent 12%),
    linear-gradient(to left,   rgba(0,0,0,0.04) 0%, transparent 12%),
    linear-gradient(to bottom, rgba(0,0,0,0.04) 0%, transparent 10%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Tooltip ---------- */
.map-tooltip {
  position: fixed;
  background: var(--ink);
  color: white;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.map-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.map-tooltip::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--ink);
  rotate: 45deg;
}

/* ---------- Admin tablosu ---------- */
table.admin-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

table.admin-table th {
  background: var(--mint);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  background: white;
}

table.admin-table tr:hover td { background: #fafafa; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary { background: var(--ink); color: white; }
.btn-primary:hover { background: black; transform: translateY(-1px); }

.btn-outline { background: white; color: var(--ink); border-color: #ddd; }
.btn-outline:hover { border-color: var(--ink); }

.btn-danger { background: var(--accent); color: white; }
.btn-danger:hover { background: #cc0000; }

/* ---------- Form inputları ---------- */
input[type=text],
input[type=password],
input[type=file],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-family: inherit;
  font-size: 14px;
  transition: border 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
}

label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}

/* ---------- Kiosk Toast Bildirimi ---------- */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.95); }
}

#kioskToast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.92);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#kioskToast.toast-hide {
  animation: toastOut 0.3s ease forwards;
}
