/* ==========================================================================
   SPORTIAL CLUB — Ortak tasarım sistemi (site + üye paneli + admin paneli)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bebas+Neue&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Marka */
  --red: #e10600;
  --red-2: #ff2a1f;
  --red-deep: #8f0400;
  --gold: #d6b25e;
  --gold-2: #f3d58a;

  /* Yüzeyler (koyu tema varsayılan) */
  --bg: #070707;
  --bg-2: #0e0e0f;
  --surface: #141416;
  --surface-2: #1b1b1e;
  --surface-3: #232327;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);

  /* Metin */
  --text: #f5f5f4;
  --text-2: #b8b8b6;
  --muted: #7d7d7b;

  /* Durum */
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;

  /* Tipografi */
  --font-display: 'Anton', 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --font-condensed: 'Bebas Neue', 'Anton', Impact, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Ölçüler */
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(225, 6, 0, .35), 0 10px 40px -10px rgba(225, 6, 0, .55);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red-2); outline-offset: 3px; border-radius: 4px; }

/* Kaydırma çubuğu */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* --- Tipografi -------------------------------------------------------------- */
.display, h1.display, h2.display {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  letter-spacing: .01em; line-height: .92; margin: 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-body); font-size: 12px; font-weight: 800; letter-spacing: .28em;
  text-transform: uppercase; color: var(--red-2);
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; }
.lead { font-size: clamp(16px, 1.4vw, 19px); color: var(--text-2); max-width: 60ch; }
.text-red { color: var(--red); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.outline-text { color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .55); }

/* --- Butonlar ----------------------------------------------------------- */
.btn {
  --b: var(--red);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--b); color: #fff; overflow: hidden; isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .3s, color .3s, border-color .3s;
  white-space: nowrap;
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, .35) 50%, transparent 80%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--red); background: rgba(225, 6, 0, .08); box-shadow: none; }
.btn-light { background: #fff; color: #0a0a0a; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1205; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 12px; }
.btn-xs { min-height: 28px; padding: 0 12px; font-size: 11px; letter-spacing: .05em; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.btn-danger { --b: #3a0d0d; color: #ff8a8a; border-color: rgba(239, 68, 68, .35); }
.btn-danger:hover { --b: var(--danger); color: #fff; box-shadow: none; }
.btn .arrow { transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* --- Formlar --------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: var(--radius-s);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  transition: border-color .25s, box-shadow .25s, background .25s; outline: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(225, 6, 0, .15); background: var(--surface); }
.select { appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23999' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.select option { background: var(--surface); }
/* iOS Safari 16px'ten küçük form alanına odaklanınca sayfayı yakınlaştırır → dokunmatik/dar ekranlarda en az 16px */
@media (max-width: 900px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea { font-size: max(16px, 1em) !important; }
}
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }

/* --- Kart ve rozet -------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px;
  position: relative;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255, 255, 255, .06); color: var(--text-2); border: 1px solid var(--line);
}
.badge-red { background: rgba(225, 6, 0, .14); color: #ff6b63; border-color: rgba(225, 6, 0, .35); }
.badge-ok { background: rgba(34, 197, 94, .12); color: #4ade80; border-color: rgba(34, 197, 94, .3); }
.badge-warn { background: rgba(245, 158, 11, .12); color: #fbbf24; border-color: rgba(245, 158, 11, .3); }
.badge-info { background: rgba(56, 189, 248, .12); color: #7dd3fc; border-color: rgba(56, 189, 248, .3); }
.badge-gold { background: rgba(214, 178, 94, .14); color: var(--gold-2); border-color: rgba(214, 178, 94, .35); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* --- Toast ------------------------------------------------------------------- */
.toast-wrap { position: fixed; z-index: 9999; right: 16px; bottom: 16px; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: rgba(20, 20, 22, .96); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); font-size: 14px; animation: toast-in .5s var(--ease) both;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.out { animation: toast-out .35s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* --- Modal --------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .7); backdrop-filter: blur(8px); animation: fade-in .3s ease both;
}
.modal {
  width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-l);
  box-shadow: var(--shadow); animation: modal-in .5s var(--ease) both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; font-family: var(--font-condensed); font-weight: 400; font-size: 28px; letter-spacing: .03em; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }

/* --- Tablo ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 14px 16px; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }

/* --- AI sohbet içeriği (markdown) ---------------------------------------------- */
.md { line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .7em; }
.md h2, .md h3, .md h4 { font-family: var(--font-condensed); font-weight: 400; letter-spacing: .03em; margin: 1.1em 0 .4em; line-height: 1.1; }
.md h2 { font-size: 1.6em; color: #fff; } .md h3 { font-size: 1.35em; } .md h4 { font-size: 1.15em; }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.3em; }
.md li { margin: .2em 0; }
.md li::marker { color: var(--red-2); }
.md strong { color: #fff; }
.md code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }

/* --- Yardımcılar -------------------------------------------------------------- */
.container { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-s); }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Gürültü dokusu */
.grain::after {
  content: ''; position: fixed; inset: -50%; z-index: 9998; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 10% { transform: translate(-5%, -10%); } 30% { transform: translate(3%, -15%); } 50% { transform: translate(12%, 9%); } 70% { transform: translate(9%, 4%); } 90% { transform: translate(-1%, 7%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   AÇIK TEMA — token karşılıkları (html[data-theme="light"], /assets/theme.js atar)
   Sabit kodlanmış koyu renklerin düzeltmeleri: /assets/theme-light.css
   ========================================================================== */
html[data-theme="light"] {
  color-scheme: light;

  /* Marka — kırmızı aynı; ikincil kırmızı ve altın açık zeminde okunur olsun diye koyulaşır */
  --red-2: #e3140a;
  --red-deep: #a10500;
  --gold: #a87f22;
  --gold-2: #c49a3f;

  /* Yüzeyler — sıcak kırık beyaz zemin, saf beyaz kartlar */
  --bg: #f6f5f3;
  --bg-2: #efeeeb;
  --surface: #ffffff;
  --surface-2: #f1f0ee;
  --surface-3: #e6e5e2;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .14);

  /* Metin */
  --text: #121212;
  --text-2: #4a4a48;
  --muted: #8a8a86;

  /* Durum — açık zeminde daha doygun */
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --info: #0284c7;

  /* Gölgeler — yumuşak, katmanlı */
  --shadow: 0 24px 60px -28px rgba(17, 17, 17, .22), 0 2px 8px -2px rgba(17, 17, 17, .06);
  --glow: 0 0 0 1px rgba(225, 6, 0, .22), 0 12px 32px -12px rgba(225, 6, 0, .45);
}

/* ===== Özel kaydırma çubukları (tüm site, panel, admin) ===== */
html { scrollbar-width: thin; scrollbar-color: #e10600 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 999px; border: 3px solid transparent; background-clip: padding-box;
  background-color: rgba(255, 255, 255, .16); background-image: linear-gradient(180deg, rgba(225, 6, 0, .9), rgba(143, 4, 0, .9)); }
::-webkit-scrollbar-thumb:hover { border-width: 2px; background-image: linear-gradient(180deg, #ff2a1f, #c20500); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(225, 6, 0, .75) transparent; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background-color: #d9d6d1; }

/* Dokunmatik ekranlarda küçük butonlar ve çipler en az 40px dokunma alanı */
@media (pointer: coarse), (max-width: 760px) {
  .btn-sm, .btn-xs, .chip { min-height: 40px; }
}
@media (pointer: coarse), (max-width: 760px) {
  .theme-toggle { min-width: 40px; min-height: 40px; }
  .auth-back, .ps-crumb a, .ps-cat, .sec-title a, .panel-head a, .card-head a { display: inline-flex; align-items: center; min-height: 40px; }
  .btn { min-height: 40px; }
  summary { min-height: 40px; display: flex; align-items: center; }
}
