/* HalkaArzVeri.com — TrVeri tasarım dili (zümrüt accent) */
:root {
  --bg: #f8fafc; --bg-card: #ffffff; --bg-hover: #f1f5f9; --bg-table-head: #f1f5f9;
  --text: #0f172a; --text-muted: #64748b;
  --border: #e2e8f0; --border-soft: #eef2f7;
  --accent: #059669; --accent2: #047857; --accent-soft: #ecfdf5;
  --green: #16a34a; --red: #dc2626; --flat: #94a3b8;
  --good-bg: #dcfce7; --good-fg: #166534;
  --warn-bg: #fef3c7; --warn-fg: #92400e;
  --info-bg: #dbeafe; --info-fg: #1e40af;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
  --header-bg: #0f172a; --header-fg: #e2e8f0;
}
:root[data-theme="dark"] {
  --bg: #0a0e1a; --bg-card: #131a2b; --bg-hover: #1a2238; --bg-table-head: #16203a;
  --text: #e2e8f0; --text-muted: #94a3b8;
  --border: #1e293b; --border-soft: #172033;
  --accent: #10b981; --accent2: #059669; --accent-soft: #06281e;
  --green: #22c55e; --red: #f87171; --flat: #64748b;
  --good-bg: #143523; --good-fg: #6ee7a0;
  --warn-bg: #3a2b10; --warn-fg: #fcd34d;
  --info-bg: #172a54; --info-fg: #93c5fd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .5);
  --header-bg: #0a0d14; --header-fg: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px; line-height: 1.6;
  background: var(--bg); color: var(--text);
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
:root[data-theme="dark"] a { color: var(--accent); }

/* ---------- header ---------- */
header { position: sticky; top: 0; z-index: 100; background: var(--header-bg); box-shadow: var(--shadow-sm); }
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 56px;
  display: flex; align-items: center; gap: 16px;
}
.logo { font-size: 19px; font-weight: 800; color: #fff; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo .logo-veri { color: #34d399; }
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
nav#mainNav { display: flex; gap: 2px; flex-wrap: wrap; }
nav#mainNav a {
  color: var(--header-fg); padding: 6px 11px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
}
nav#mainNav a:hover { background: rgba(255, 255, 255, .09); text-decoration: none; }
nav#mainNav a.active { background: rgba(52, 211, 153, .16); color: #34d399; }
.nav-toggle {
  display: none; background: none; border: 1px solid rgba(255, 255, 255, .25);
  color: #fff; font-size: 17px; border-radius: 8px; padding: 4px 10px; cursor: pointer;
}
.theme-toggle {
  background: none; border: 1px solid rgba(255, 255, 255, .25); color: var(--header-fg);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .09); }

main { max-width: 1200px; margin: 0 auto; padding: 26px 20px 56px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 34px 30px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 60%, #065f46 100%);
  color: #fff; box-shadow: var(--shadow-md); margin-bottom: 26px;
}
.hero::after {
  content: "📈"; position: absolute; right: -10px; bottom: -30px;
  font-size: 170px; opacity: .10; transform: rotate(-8deg);
}
.hero h1 { font-size: 27px; font-weight: 900; letter-spacing: -.3px; margin-bottom: 8px; }
.hero p { font-size: 15px; max-width: 720px; opacity: .94; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero-badges span {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.hero .updated { margin-top: 12px; font-size: 12px; opacity: .8; }

/* ---------- section ---------- */
.section { margin: 30px 0; }
.section-title {
  font-size: 19px; font-weight: 800; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.section-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.section-title .more { margin-left: auto; font-size: 13px; font-weight: 600; }

/* ---------- stat kartları ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat-card .v { font-size: 24px; font-weight: 800; color: var(--accent2); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .stat-card .v { color: var(--accent); }
.stat-card .v.up { color: var(--green); }
.stat-card .v.down { color: var(--red); }
.stat-card .l { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- arz kartları (aktif/yaklaşan) ---------- */
.ipo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ipo-card {
  background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s; display: block; color: var(--text);
}
.ipo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.ipo-card .t { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ipo-card .code { font-weight: 800; font-size: 15px; color: var(--accent2); }
:root[data-theme="dark"] .ipo-card .code { color: var(--accent); }
.ipo-card .name { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.ipo-card .kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 2px 0; }
.ipo-card .kv .k { color: var(--text-muted); }
.ipo-card .kv .v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- şirket logoları ---------- */
.tlogo, .dlogo {
  object-fit: contain; border-radius: 6px; background: #fff;
  border: 1px solid var(--border); flex: none; vertical-align: middle;
}
.dlogo { border-radius: 9px; padding: 3px; margin-right: 4px; }
:root[data-theme="dark"] .tlogo, :root[data-theme="dark"] .dlogo { background: #f1f5f9; }

/* ---------- badge ---------- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-talep { background: var(--good-bg); color: var(--good-fg); }
.badge-yaklasan { background: var(--warn-bg); color: var(--warn-fg); }
.badge-bekliyor { background: var(--info-bg); color: var(--info-fg); }
.badge-tamam { background: var(--bg-hover); color: var(--text-muted); }
.badge-tavan { background: var(--good-bg); color: var(--good-fg); }

/* ---------- getiri renkleri ---------- */
.pct-up { color: var(--green); font-weight: 700; }
.pct-down { color: var(--red); font-weight: 700; }
.pct-flat { color: var(--flat); font-weight: 600; }
.pct-na { color: var(--text-muted); }

/* ---------- tablo ---------- */
.data-table-wrap {
  overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead th {
  background: var(--bg-table-head); color: var(--text); text-align: left;
  padding: 10px 12px; font-size: 12px; font-weight: 800; white-space: nowrap;
  border-bottom: 2px solid var(--accent); position: sticky; top: 0; user-select: none;
}
table.data-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-hover) 45%, transparent); }
table.data-table tbody tr:hover { background: var(--bg-hover); }
table.data-table td.num, table.data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.s-arrow { color: var(--accent2); font-size: 10px; }

/* ---------- filtre chips ---------- */
.fchips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.fchip {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.fchip:hover { border-color: var(--accent); }
.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- detay künye ---------- */
.kunye {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.kunye .cell { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); }
.kunye .cell .k { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.kunye .cell .v { font-size: 15px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

/* ---------- grafik ---------- */
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.chart-card svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-top: 8px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* ---------- içerik / rehber ---------- */
.prose { max-width: 780px; }
.prose h2 { font-size: 19px; font-weight: 800; margin: 26px 0 10px; }
.prose h3 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 10px 0 10px 22px; }
.prose li { margin: 4px 0; }
.prose .data-table-wrap { margin: 14px 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.link-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .15s, border-color .15s;
}
.link-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.link-card .ic { font-size: 24px; }
.link-card h3 { font-size: 15px; font-weight: 700; margin: 8px 0 4px; }
.link-card p { font-size: 12.5px; color: var(--text-muted); }

/* ---------- hesaplayıcı ---------- */
.calc {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow-sm); max-width: 640px;
}
.calc label { display: block; font-size: 12.5px; font-weight: 700; margin: 12px 0 4px; }
.calc input, .calc select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.calc input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.calc .result {
  margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--accent-soft);
  border: 1px solid var(--accent); font-size: 14px; display: none;
}
.calc .result.show { display: block; }
.calc .result .big { font-size: 22px; font-weight: 800; color: var(--accent2); }
:root[data-theme="dark"] .calc .result .big { color: var(--accent); }
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 10px 22px; font-size: 14px; font-weight: 700;
  cursor: pointer; margin-top: 16px;
}
.btn:hover { background: var(--accent2); text-decoration: none; }

/* ---------- uyarı / bilgi kutusu ---------- */
.notice {
  background: var(--warn-bg); color: var(--warn-fg); border-radius: 12px;
  padding: 12px 16px; font-size: 13px; margin: 16px 0;
}
.notice-info { background: var(--info-bg); color: var(--info-fg); }
.crumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.crumb a { color: var(--text-muted); }

/* ---------- footer ---------- */
footer { background: var(--header-bg); color: #94a3b8; margin-top: 40px; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 26px 20px;
  display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 12.5px; align-items: center;
}
.footer-inner .fi-grow { flex: 1; }
footer a { color: #cbd5e1; }
footer a[href*="trveri.com"] { color: #fff !important; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
footer a[href*="trveri.com"]:hover { color: #34d399 !important; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  nav#mainNav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: var(--header-bg); flex-direction: column; padding: 10px 16px 16px; gap: 4px;
    box-shadow: var(--shadow-md);
  }
  nav#mainNav.open { display: flex; }
  .theme-toggle .toggle-text { display: none; }
}
@media (max-width: 640px) {
  .hero { padding: 26px 20px; }
  .hero h1 { font-size: 22px; }
  /* tablo → kart (cardify) */
  table.data-table.cardify thead { display: none; }
  table.data-table.cardify tbody tr {
    display: block; padding: 10px 14px; border-bottom: 1px solid var(--border);
  }
  table.data-table.cardify tbody td {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 3px 0; border: none; white-space: normal; text-align: right;
  }
  table.data-table.cardify tbody td::before {
    content: attr(data-label); font-weight: 600; color: var(--text-muted); text-align: left;
  }
  table.data-table.cardify tbody td:first-child { font-weight: 700; }
}
