@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #0a101d;
  --bg-panel: #121a2c;
  --bg-panel-2: #182238;
  --line: #24314c;
  --text: #e8edf7;
  --text-dim: #8ea0bf;
  --amber: #f5a623;
  --cyan: #35c9c1;
  --danger: #e5583d;
  --success: #4cc38a;
  --radius: 10px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(53,201,193,0.10), transparent),
    radial-gradient(ellipse 700px 400px at 100% 0%, rgba(245,166,35,0.08), transparent),
    linear-gradient(rgba(10,16,29,0.90), rgba(10,16,29,0.90)),
    url('/img/tanet-bg.jpg');
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: 0 0, 0 0, center, center;
  background-size: auto, auto, cover, cover;
  background-attachment: scroll, scroll, fixed, fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 20px 80px; }
.wrap.wide { max-width: 1180px; }

/* ---- Ana sayfa iki kolon (leaderboard + kayit formu) ---- */
.app-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.sidebar .card table { font-size: 0.84rem; }
.sidebar .card tbody tr { cursor: pointer; }
.sidebar .card tbody tr:hover td { background: var(--bg-panel-2); }
.sidebar .card tbody tr.selected td { background: rgba(53,201,193,0.12); border-color: rgba(53,201,193,0.4); }
.sidebar .card td.weeks { font-family: var(--font-mono); color: var(--text-dim); text-align: right; }
@media (max-width: 860px) {
  .app-grid { grid-template-columns: 1fr; }
}

/* ---- Giris tanitim metni ---- */
.intro-banner {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.intro-banner p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}
.intro-banner strong { color: var(--text); }
.intro-banner #statsLine { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.intro-banner .stat-num {
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  color: var(--amber);
}

/* ---- Header / signature orbit element ---- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand:hover h1 { color: var(--cyan); }
.brand h1 {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 700;
  margin: 0; letter-spacing: 0.01em;
}
.brand .sub { color: var(--text-dim); font-size: 0.82rem; margin-top: 2px; }

.orbit { width: 54px; height: 54px; flex-shrink: 0; }

.who { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-dim); }
.who .pill { background: var(--bg-panel-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.who a, .who button.linklike {
  color: var(--cyan); text-decoration: none; background: none; border: none; font: inherit; cursor: pointer; padding: 0;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px;
  margin-bottom: 18px;
}
.card h2 {
  font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}

/* ---- Status banner ---- */
.status {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px;
  border: 1px solid var(--line); font-size: 0.92rem;
}
.status .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status.open { background: rgba(76,195,138,0.08); border-color: rgba(76,195,138,0.35); }
.status.open .dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status.before { background: rgba(245,166,35,0.08); border-color: rgba(245,166,35,0.35); }
.status.before .dot { background: var(--amber); }
.status .entry-cta { margin-left: auto; flex-shrink: 0; white-space: nowrap; }
.status.after { background: rgba(142,160,191,0.08); border-color: var(--line); }
.status.after .dot { background: var(--text-dim); }

/* ---- Forms ---- */
label { display: block; font-size: 0.82rem; color: var(--text-dim); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; background: var(--bg-panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 11px 12px; border-radius: 8px; font-size: 0.95rem;
  font-family: var(--font-body);
}
input.mono, .callsign-input, .locator-input, .report-input { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.03em; }
input:focus, select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--cyan); }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; }
.checkbox-row input { width: 16px; height: 16px; }
.checkbox-row label { margin: 0; font-size: 0.88rem; color: var(--text); }

.btn {
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  border: none; border-radius: 8px; padding: 12px 20px; cursor: pointer;
  background: var(--amber); color: #1a1300; margin-top: 18px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--bg-panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--cyan); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #2a0a04; }
.btn.small { padding: 7px 12px; font-size: 0.8rem; margin-top: 0; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.search-row { display: flex; gap: 8px; align-items: flex-start; }
.search-row input { flex: 1; }
.search-row .btn { margin-top: 0; }

.msg { margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 0.88rem; border: 1px solid transparent; }
.msg.error { background: rgba(229,88,61,0.1); border-color: rgba(229,88,61,0.4); color: #ffb4a3; }
.msg.success { background: rgba(76,195,138,0.1); border-color: rgba(76,195,138,0.4); color: #a6f0cd; }
.msg.info { background: rgba(53,201,193,0.08); border-color: rgba(53,201,193,0.35); color: #b7ece8; }

.hr { height: 1px; background: var(--line); margin: 20px 0; border: none; }

.hint { color: var(--text-dim); font-size: 0.88rem; margin: -4px 0 18px; line-height: 1.5; }

.divider-or { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 0.78rem; margin: 18px 0; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--text-dim); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
td.callsign { font-family: var(--font-mono); font-weight: 700; color: var(--amber); }
td.locator { font-family: var(--font-mono); color: var(--cyan); }
.report-badge {
  font-family: var(--font-mono); background: var(--bg-panel-2); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 999px; font-size: 0.78rem;
}
.badge-swl { background: rgba(245,166,35,0.12); border-color: rgba(245,166,35,0.4); color: var(--amber); padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-op { font-size: 0.9rem; }
.badge-source { color: var(--text-dim); font-size: 0.72rem; }
.empty-row td { color: var(--text-dim); text-align: center; padding: 22px; }

/* ---- Tabs (admin) ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; color: var(--text-dim); font-family: var(--font-display);
  font-size: 0.9rem; padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--amber); }
.tabpanel { display: none; }
.tabpanel.active { display: block; }

.count-chip { font-family: var(--font-mono); background: var(--bg-panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 0.75rem; color: var(--text-dim); }

/* ---- Turkiye katilim haritasi ---- */
.map-container { width: 100%; max-width: 720px; margin: 0 auto; }
.map-container svg { width: 100%; height: auto; display: block; }
.map-container .tr-frame { fill: rgba(255,255,255,0.03); stroke: none; }
.map-container .tr-il { fill: var(--bg-panel-2); stroke: var(--line); stroke-width: 0.6; transition: fill 0.25s; cursor: pointer; }
.map-container .tr-il.active-op { fill: var(--cyan); }
.map-container .tr-il.active-swl { fill: var(--amber); }
#mapTitle { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 14px; text-align: center; }
.map-filters { display: flex; gap: 20px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.map-filters .checkbox-row { margin: 0; }
.map-filters .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.map-filters .swatch.op { background: var(--cyan); }
.map-filters .swatch.swl { background: var(--amber); }
.map-hint { text-align: center; color: var(--text-dim); font-size: 0.8rem; margin-top: 10px; }
.map-il-detail { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.map-il-detail h3 {
  font-family: var(--font-display); font-size: 0.95rem; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.map-il-detail table { font-size: 0.85rem; }
.map-il-detail h4 {
  font-family: var(--font-display); font-size: 0.82rem; margin: 0 0 8px;
  color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.il-top-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.il-top-grid td.weeks { font-family: var(--font-mono); color: var(--text-dim); text-align: right; }
@media (max-width: 640px) {
  .il-top-grid { grid-template-columns: 1fr; }
}

/* ---- Leaderboard gecmis paneli / hafta detayi ---- */
.history-panel { margin-top: 4px; }
.history-panel:empty { margin-top: 0; }
.history-panel h3 {
  font-family: var(--font-display); font-size: 0.86rem; margin: 14px 0 8px;
  color: var(--text-dim); font-weight: 600;
}
.history-panel table { font-size: 0.8rem; }
.history-panel .empty-hint { color: var(--text-dim); font-size: 0.82rem; padding: 8px 0; }
#weekDetail { margin-top: 4px; }
#weekDetail h3 {
  font-family: var(--font-display); font-size: 0.82rem; margin: 16px 0 8px;
  color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
#weekDetail table { font-size: 0.8rem; }

.auth-toggle { display: flex; gap: 8px; margin-bottom: 16px; }

footer.foot { text-align: center; color: var(--text-dim); font-size: 0.76rem; margin-top: 30px; }
