/* YAYBİL Analysis – koyu tema panel */
:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #182033;
  --border: #1f2a3d;
  --text: #e6edf3;
  --text-2: #aab4c3;
  --muted: #7d8899;
  --accent: #f5b50a;
  --accent-ink: #1a1200;
  --accent-2: #38bdf8;
  --up: #2fbf71;
  --down: #ef5350;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h2 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.muted { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------------------------------------------------------------- üst bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px;
  background: rgba(11, 15, 23, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: 17px;
}
.brand-text { font-size: 16px; letter-spacing: 0.02em; }
.brand-text strong { color: var(--accent); }
.views { display: flex; gap: 4px; margin-left: 8px; }
.views button {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 12px; color: var(--text-2); font-weight: 600;
}
.views button:hover { color: var(--text); background: var(--surface-2); }
.views button.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.live { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.clock { font-family: var(--mono); font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 0 transparent; }
.live-dot.ok { background: var(--up); animation: pulse 2s infinite; }
.live-dot.err { background: var(--down); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(47, 191, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); }
}

.ticker-wrap { height: 46px; border-bottom: 1px solid var(--border); background: var(--surface); overflow: hidden; }

/* ------------------------------------------------------------------ düzen */
.layout { max-width: 1680px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}

.market {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr);
  grid-template-areas: "chart side" "table table";
}
.market .chart-card { grid-area: chart; display: flex; flex-direction: column; }
.market .side { grid-area: side; display: grid; gap: 16px; align-content: start; }
.market .table-card { grid-area: table; }
.tv-chart { flex: 1; min-height: 480px; }
.tv-chart .tradingview-widget-container, .tv-chart .tradingview-widget-container__widget { height: 100%; width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; font-weight: 600; color: var(--text-2);
}
.chips button:hover { color: var(--text); border-color: var(--muted); }
.chips button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--surface-2); color: var(--text); }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ----------------------------------------------------------------- tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); overflow: hidden; }
.tile { background: var(--surface); padding: 12px 14px; min-width: 0; }
.tile-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tile-value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* ------------------------------------------------------------------- fng */
.fng { padding: 14px; display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.fng svg { width: 160px; height: 96px; display: block; }
.fng-value { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.fng-label { font-size: 14px; font-weight: 600; margin-top: 4px; }
.fng-title { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.fng-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ----------------------------------------------------------------- tablo */
.table-scroll { overflow-x: auto; }
.market-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.market-table th, .market-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.market-table th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; text-align: left; }
.market-table th.num, .market-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.market-table tbody tr { cursor: pointer; }
.market-table tbody tr:hover { background: var(--surface-2); }
.market-table tbody tr:last-child td { border-bottom: 0; }
.market-table td.empty { text-align: center; color: var(--muted); padding: 24px; }
.asset { display: flex; align-items: center; gap: 10px; }
.asset img { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); }
.asset .sym { color: var(--muted); font-size: 12px; margin-left: 4px; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.spark-col { width: 120px; }
.spark { width: 100px; height: 28px; display: block; }

/* ------------------------------------------------------------------ borsa */
.exchanges { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.tv-card { display: flex; flex-direction: column; }
.tv-embed { flex: 1; min-height: 520px; }
.tv-embed .tradingview-widget-container, .tv-embed .tradingview-widget-container__widget { height: 100%; width: 100%; }
.fund-table td.name { max-width: 420px; white-space: normal; line-height: 1.25; }
.fund-table .code { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.fund-table .ftype { color: var(--muted); font-size: 11.5px; display: block; }
.funds .column-tools { flex-wrap: wrap; }
.funds .search { max-width: 260px; }

/* ----------------------------------------------------------------- vadeli */
.derivs { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.liq-card { display: flex; flex-direction: column; max-height: 640px; }
.liq-summary { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.liq-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.liq-bar .long { background: var(--down); }
.liq-bar .short { background: var(--up); }
.liq-totals { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.liq-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; font-size: 12.5px; }
.liq-list li { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--border); align-items: center; font-variant-numeric: tabular-nums; }
.liq-list li.big { background: rgba(245, 181, 10, 0.08); }
.liq-list .sym { font-weight: 700; font-family: var(--mono); }
.liq-list .side { font-weight: 600; }
.liq-list .amt { font-weight: 700; }
.liq-list .t { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.liq-list .empty { display: block; text-align: center; color: var(--muted); padding: 24px; }
.liq-card h2 .live-dot { display: inline-block; vertical-align: middle; margin-left: 6px; }

/* ----------------------------------------------------------------- balina */
.whales { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.whale-list li { grid-template-columns: 64px minmax(0, 1fr) auto auto; }
.whale-list .route { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whale-list .route b { color: var(--text); }
.flow-in { color: var(--down); font-weight: 600; }
.flow-out { color: var(--up); font-weight: 600; }
.flow-mid { color: var(--muted); font-weight: 600; }
.whale-list .empty a { color: var(--accent-2); }

/* ------------------------------------------ görünümler (üst menü = sayfa) */
body:not([data-view="panel"]):not([data-view="piyasa"]) .market { display: none; }
body:not([data-view="borsa"]) .exchanges { display: none; }
body:not([data-view="vadeli"]) .derivs { display: none; }
body:not([data-view="balina"]) .whales { display: none; }
body:not([data-view="fonlar"]) .funds { display: none; }
body[data-view="piyasa"] .news, body[data-view="borsa"] .news, body[data-view="vadeli"] .news,
body[data-view="balina"] .news, body[data-view="fonlar"] .news { display: none; }
body[data-view="regulation"] .column:not([data-cat="regulation"]),
body[data-view="crypto"] .column:not([data-cat="crypto"]),
body[data-view="politics"] .column:not([data-cat="politics"]) { display: none; }
body[data-view="regulation"] .news, body[data-view="crypto"] .news, body[data-view="politics"] .news { grid-template-columns: 1fr; }
body[data-view="regulation"] .column, body[data-view="crypto"] .column, body[data-view="politics"] .column { max-height: none; min-height: 0; }
@media (min-width: 900px) {
  body[data-view="regulation"] .items, body[data-view="crypto"] .items, body[data-view="politics"] .items {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; overflow: visible;
  }
  body[data-view="regulation"] .item, body[data-view="crypto"] .item, body[data-view="politics"] .item { align-content: start; }
}

/* --------------------------------------------------------------- haberler */
.news { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.column { display: flex; flex-direction: column; max-height: calc(100vh - 90px); min-height: 420px; }
.column-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.column-head h2 { display: flex; align-items: center; gap: 8px; }
.column[data-cat="regulation"] h2 .col-title::before,
.column[data-cat="crypto"] h2 .col-title::before,
.column[data-cat="politics"] h2 .col-title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 1px;
}
.column[data-cat="regulation"] h2 .col-title::before { background: var(--accent); }
.column[data-cat="crypto"] h2 .col-title::before { background: var(--accent-2); }
.column[data-cat="politics"] h2 .col-title::before { background: #c084fc; }
.badge {
  display: inline-block; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); font-weight: 600;
}
.column-tools { display: flex; gap: 8px; align-items: center; }
.search {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 10px; font-size: 13px; outline: none;
}
.search:focus { border-color: var(--accent-2); }
.items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.item { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); transition: background 0.3s; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item.new { background: rgba(245, 181, 10, 0.06); box-shadow: inset 3px 0 0 var(--accent); }
.item-body { min-width: 0; flex: 1; }
.item-title { display: block; font-weight: 600; font-size: 14px; line-height: 1.35; text-decoration: none; color: var(--text); }
.item-title:hover { text-decoration: underline; text-decoration-color: var(--muted); }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
.item-meta .src { color: var(--text-2); font-weight: 600; }
.item-meta .lang { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.tag { border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 11px; color: var(--text-2); }
.tag.official { border-color: rgba(245, 181, 10, 0.5); color: var(--accent); }
.tag.new-badge { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.tag.translated { color: var(--accent-2); border-color: rgba(56, 189, 248, 0.45); }
.tag.viral { color: #f472b6; border-color: rgba(244, 114, 182, 0.45); }
.orig { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.column-tools { flex-wrap: wrap; }
.seg.group button.active { background: var(--accent); color: var(--accent-ink); }
.summary {
  margin: 4px 0 0; font-size: 12.5px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); }
.items .empty { padding: 28px 14px; color: var(--muted); text-align: center; }
.column-foot { padding: 8px 14px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------- alt */
.foot { max-width: 1680px; margin: 0 auto; padding: 8px 16px 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transition: all 0.25s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3650; border-radius: 10px; border: 2px solid var(--surface); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ duyarlılık */
@media (max-width: 1200px) {
  .news { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .column { max-height: 70vh; }
}
@media (max-width: 900px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-text { display: none; }
  .views { margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .views::-webkit-scrollbar { display: none; }
  .views button { padding: 6px 9px; font-size: 13px; }
  .stamp { display: none; }
  .layout { padding: 12px; }
  .market { grid-template-columns: 1fr; grid-template-areas: "chart" "side" "table"; }
  .tv-chart { min-height: 380px; }
  .news { grid-template-columns: 1fr; }
  .column { max-height: none; }
  .exchanges, .derivs, .whales { grid-template-columns: 1fr; }
  .tv-embed { min-height: 440px; }
}
@media (max-width: 520px) {
  .fng { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .thumb { display: none; }
}
