/* Borsa Merkezi — arayüz stilleri
   Açık ve koyu tema, işletim sistemi tercihine göre otomatik. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-raised: #ffffff;
  --border: #e3e6ea;
  --border-strong: #cbd2da;
  --text: #16191d;
  --text-soft: #5b6470;
  --text-muted: #8b949e;
  --accent: #1c6fd4;
  --accent-soft: #e8f0fb;
  --up: #0f9d58;
  --up-soft: #e6f5ed;
  --down: #d93025;
  --down-soft: #fdecea;
  --warn: #b06f00;
  --warn-soft: #fff4e0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --bg-soft: #151a21;
    --bg-raised: #161b22;
    --border: #262d36;
    --border-strong: #363f4a;
    --text: #e6edf3;
    --text-soft: #9aa5b1;
    --text-muted: #6e7781;
    --accent: #58a6ff;
    --accent-soft: #12233b;
    --up: #3fb950;
    --up-soft: #10261a;
    --down: #f85149;
    --down-soft: #2b1416;
    --warn: #d29922;
    --warn-soft: #2a2010;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.muted { color: var(--text-muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-muted); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Başlık ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 13px; letter-spacing: .3px;
}
.brand-text { font-size: 17px; font-weight: 500; }
.brand-text strong { font-weight: 700; }
.nav a { color: var(--text-soft); font-size: 14px; font-weight: 500; }

/* ---------- Sayfa başlığı ---------- */

.page-head { padding: 34px 0 8px; }
h1 { font-size: 27px; margin: 0 0 8px; letter-spacing: -.3px; }
h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -.2px; }
.lede { color: var(--text-soft); max-width: 62ch; margin: 0 0 10px; }
.lede-sm { color: var(--text-soft); font-size: 14px; margin: 0 0 16px; max-width: 70ch; }

.data-stamp {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; margin: 0;
}

.badge {
  display: inline-block; padding: 1px 7px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Yükselen/düşen ---------- */

.movers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 24px 0;
}
.mover-col {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.mover-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  margin: 0 0 12px; font-weight: 700;
}
.mover-title.up { color: var(--up); }
.mover-title.down { color: var(--down); }
.mover-list { list-style: none; margin: 0; padding: 0; }
.mover-list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px;
  align-items: baseline; padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.mover-list li:last-child { border-bottom: 0; }
.mover-list .code { font-weight: 600; font-size: 14px; }
.mover-list .price, .mover-list .chg {
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
}
.mover-list .chg { min-width: 68px; text-align: right; font-weight: 600; }

/* ---------- Tablo ---------- */

.table-section { margin: 28px 0 40px; }
.table-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.table-head h2 { margin: 0; }
.filter {
  flex: 0 1 280px;
  padding: 8px 12px; font-size: 14px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.filter:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
/* Başlık satırı bilinçli olarak sticky DEĞİL.
   .table-scroll yatay kaydırma için overflow-x:auto kullanıyor; CSS bu
   durumda dikey eksende de kaydırma bağlamı yaratıyor. Sonuç olarak
   position:sticky viewport'a değil bu kutuya göre konumlanıyor ve başlık
   ilk satırların üzerine biniyor. */
.data-table thead th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 700;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table thead th.num { text-align: right; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--bg-soft); }
.col-code { width: 84px; }
.code-link { font-weight: 700; letter-spacing: .2px; }
.col-name {
  color: var(--text-soft); max-width: 340px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.empty {
  padding: 28px 4px; color: var(--text-muted); text-align: center; font-size: 14px;
}

/* ---------- Hisse detay ---------- */

.crumbs { padding: 20px 0 0; font-size: 13px; color: var(--text-muted); }
.crumbs span { margin: 0 2px; }

.symbol-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; padding: 14px 0 22px;
  border-bottom: 1px solid var(--border);
}
.symbol-id h1 { margin: 0; font-size: 32px; letter-spacing: -.5px; }
.company { margin: 4px 0 0; color: var(--text-soft); font-size: 14px; }
.symbol-price { text-align: right; }
.last-price { font-size: 30px; font-weight: 600; letter-spacing: -.5px; }
.last-price .cur { font-size: 17px; color: var(--text-muted); font-weight: 400; }
.last-change { font-size: 15px; font-weight: 600; margin-top: 2px; }
.as-of { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.stat-grid {
  display: grid; gap: 12px; margin: 22px 0;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stat {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.stat-label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px;
}
.stat-value { font-size: 15px; font-weight: 600; }

/* ---------- Kart ---------- */

.card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin: 20px 0;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h2 { margin: 0; }

.range-buttons { display: flex; gap: 4px; }
.rb {
  padding: 5px 11px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text-soft); border-radius: 7px; cursor: pointer;
  font-family: inherit;
}
.rb:hover { border-color: var(--accent); color: var(--accent); }
.rb.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.chart { width: 100%; height: 380px; }
.chart-sm { height: 150px; margin-top: 8px; }
.chart-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-soft); padding: 8px 2px 0;
  font-family: var(--mono);
}
.legend-swatch {
  display: inline-block; width: 10px; height: 3px;
  border-radius: 2px; margin-right: 6px; vertical-align: middle;
}

.note {
  font-size: 12.5px; color: var(--text-muted);
  margin: 10px 0 0; max-width: 74ch; line-height: 1.5;
}

.indicator-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.indicator {
  padding: 12px 14px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 8px;
}
.ind-label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px;
}
.ind-value { font-size: 16px; font-weight: 600; }

.callout {
  margin-top: 16px; padding: 14px 16px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 6px; font-size: 13.5px; line-height: 1.6; color: var(--text-soft);
}
.callout strong { color: var(--text); }

.fine-print {
  font-size: 12px; color: var(--text-muted);
  margin: 10px 0 0; line-height: 1.5;
}

/* ---------- Alt bilgi ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  margin-top: 48px; padding: 26px 0 34px;
}
.disclaimer {
  font-size: 12.5px; line-height: 1.65; color: var(--text-soft);
  max-width: 84ch; margin-bottom: 16px;
}
.disclaimer strong { color: var(--text); }
.footer-meta {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  padding-top: 14px; border-top: 1px solid var(--border);
}

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

@media (max-width: 720px) {
  .movers { grid-template-columns: 1fr; }
  .col-hide { display: none; }
  .col-name { max-width: 140px; }
  h1 { font-size: 23px; }
  .symbol-id h1 { font-size: 27px; }
  .last-price { font-size: 25px; }
  .chart { height: 300px; }
  .wrap { padding: 0 14px; }
}
