/* ============================================================
   GYMBUL Türkiye Kulüp Haritası — koyu tema
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --surface: rgba(15, 16, 24, 0.82);
  --surface-solid: #12131c;
  --border: rgba(255, 255, 255, 0.08);
  --ink: #f4f5f7;
  --ink-2: #a8adba;
  --ink-3: #6b7080;
  --accent: #ff7a18;
  --accent-2: #ffb300;
  --accent-glow: rgba(255, 122, 24, 0.45);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --radius: 18px;
}

:root[data-theme="light"] {
  --bg: #eef0f4;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --border: rgba(20, 28, 45, 0.1);
  --ink: #171a21;
  --ink-2: #4a5060;
  --ink-3: #8a90a0;
  --accent: #f06400;
  --accent-2: #e59000;
  --accent-glow: rgba(240, 100, 0, 0.3);
  --shadow: 0 24px 60px rgba(30, 40, 60, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

#map {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1;
}

/* ---------- Sol panel ---------- */

.panel {
  position: fixed;
  top: 20px;
  left: 20px;
  bottom: 20px;
  width: 330px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 22px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  font-size: 34px;
  filter: drop-shadow(0 0 14px var(--accent-glow));
}

.logo h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.logo .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 2px 0 0;
  font-size: 11.5px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent-2);
  background: rgba(255, 179, 0, 0.1);
  border: 1px solid rgba(255, 179, 0, 0.25);
  padding: 5px 9px;
  border-radius: 999px;
  margin-top: 4px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-2); }
  50%      { opacity: 0.35; box-shadow: none; }
}

/* ---------- İstatistikler ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 22px 18px;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px 12px;
  text-align: center;
}

.stat-value {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff, #ffd9b0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Şehir sıralaması ---------- */

.ranking {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 22px 0;
}

.ranking h2 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-2);
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 12px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.ranking-list::-webkit-scrollbar { width: 5px; }
.ranking-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.rank-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.rank-item:hover {
  background: rgba(255, 122, 24, 0.1);
  transform: translateX(3px);
}

.rank-no {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  text-align: center;
}

.rank-item:nth-child(1) .rank-no,
.rank-item:nth-child(2) .rank-no,
.rank-item:nth-child(3) .rank-no { color: var(--accent-2); }

.rank-city {
  min-width: 0;
}

.rank-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-bar {
  height: 4px;
  margin-top: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-count {
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.panel-footer {
  padding: 12px 22px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
}

.panel-footer strong { color: var(--ink-2); }

/* ---------- Ana sayfaya dönüş ---------- */

.back-home {
  position: fixed;
  top: 20px;
  left: 366px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Inter", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.back-home:hover {
  color: var(--ink);
  transform: translateX(-3px);
}

.back-home .back-arrow {
  font-size: 15px;
  line-height: 1;
}

/* ---------- Kontroller ---------- */

.controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}

.ctrl-btn {
  font-family: "Inter", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ctrl-btn:hover { color: var(--ink); }

.ctrl-btn.active {
  color: #1a1104;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 4px 18px var(--accent-glow);
}

/* ---------- Lejant ---------- */

.legend {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
}

.legend-label {
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.legend-ramp {
  width: 110px;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg,
    #160b39 0%, #6a1c6e 28%, #a52c60 48%,
    #e55c30 68%, #f98e09 84%, #fcffa4 100%);
}

/* ---------- Kulüp işaretçileri ---------- */
/* Konumlandırmayı Leaflet yapar (.leaflet-marker-icon, absolute) — burada position ezilmemeli */

.club-dot .core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-glow), 0 0 4px #fff inset;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.club-dot .pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.4); opacity: 0.9; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ---------- Açık tema özel ayarları ---------- */

:root[data-theme="light"] .stat {
  background: rgba(20, 28, 45, 0.045);
}

:root[data-theme="light"] .stat-value {
  background: linear-gradient(180deg, #232838, #b5540a);
  -webkit-background-clip: text;
  background-clip: text;
}

:root[data-theme="light"] .legend-ramp {
  background: linear-gradient(90deg,
    #ffeda0 0%, #fed976 25%, #fd8d3c 48%,
    #f03b20 70%, #bd0026 88%, #800026 100%);
}

:root[data-theme="light"] .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.75) !important;
}

/* ---------- Leaflet koyu tema uyarlaması ---------- */

.leaflet-container {
  font-family: "Inter", sans-serif;
  background: var(--bg);
}

.leaflet-popup-content-wrapper {
  background: var(--surface-solid);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.leaflet-popup-tip {
  background: var(--surface-solid);
  border: 1px solid var(--border);
}

.leaflet-popup-content { margin: 14px 18px; }

.popup-club {
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 3px;
}

.popup-city {
  font-size: 12px;
  color: var(--ink-2);
  margin: 0;
}

.popup-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-2);
  background: rgba(255, 179, 0, 0.12);
  border: 1px solid rgba(255, 179, 0, 0.3);
  border-radius: 999px;
  padding: 3px 8px;
}

.leaflet-popup-close-button { color: var(--ink-3) !important; }

.leaflet-control-zoom a {
  background: var(--surface-solid) !important;
  color: var(--ink) !important;
  border-color: var(--border) !important;
}

.leaflet-control-attribution {
  background: rgba(10, 10, 15, 0.7) !important;
  color: var(--ink-3) !important;
  font-size: 9.5px !important;
}

.leaflet-control-attribution a { color: var(--ink-2) !important; }

/* ---------- Mobil ---------- */

.panel-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  font-size: 18px;
  color: var(--ink);
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 55vh;
  }

  .panel.hidden {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
  }

  .panel-toggle { display: block; }

  .controls {
    top: 20px;
    right: 12px;
  }

  .back-home {
    top: 74px;
    left: 12px;
    padding: 8px 13px;
    font-size: 12px;
  }

  .legend { display: none; }
}
