/* RakipTakip Dashboard — AdSnap/Claude tasarım sistemi (krem + koyu, tema-duyarlı) */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --accent: #D97757; --accent-ink: #C45D3A;
  --green: #5B9A6B; --red: #C9624B; --amber: #B97A12; --blue: #3F7CB8;
  --radius-sm: 10px; --radius: 14px; --radius-lg: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* koyu (varsayılan) */
  --bg: #100F0D; --bg2: #1C1A16; --bg3: rgba(255,255,255,0.05);
  --surface: #1C1A16; --surface-2: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.12); --border-strong: rgba(255,255,255,0.22);
  --text: #F4EFE6; --text-strong: #FFFFFF; --sub: #C9C1B2; --muted: #A49C8C;
  --chip: rgba(255,255,255,0.06); --shadow: 0 22px 60px rgba(0,0,0,0.5);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #F6F2EA; --bg2: #FFFFFF; --bg3: rgba(0,0,0,0.035);
  --surface: #FFFFFF; --surface-2: rgba(0,0,0,0.035);
  --border: rgba(0,0,0,0.10); --border-strong: rgba(0,0,0,0.18);
  --text: #211E1A; --text-strong: #14110D; --sub: #5C5648; --muted: #8A8273;
  --chip: rgba(0,0,0,0.04); --shadow: 0 22px 60px rgba(60,40,20,0.12);
  color-scheme: light;
}

body {
  display: flex; height: 100vh; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px; -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar {
  width: 224px; flex-shrink: 0;
  background: var(--bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 24px 0 18px;
}
.logo {
  font-family: var(--font-serif); font-size: 26px; font-weight: 400; color: var(--text-strong);
  padding: 0 20px 26px; display: flex; align-items: center; gap: 8px; letter-spacing: -.3px;
}
.logo span { color: var(--accent); }

nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
.nav-btn {
  width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px;
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; transition: background .15s, color .15s, border-color .15s;
}
.nav-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-btn.active { color: var(--text-strong); background: var(--surface); border-color: var(--border); }

.sidebar-footer {
  padding: 16px 12px 0; display: flex; flex-direction: column; gap: 7px;
  border-top: 1px solid var(--border); margin: 0 12px;
}
.sidebar-footer button {
  padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; transition: background .15s, border-color .15s; text-align: left;
}
.sidebar-footer button:hover { border-color: var(--border-strong); background: var(--chip); }
.plan-badge {
  padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  text-align: center; margin-bottom: 4px; border: 1px solid var(--border);
}
.plan-free  { background: var(--surface-2); color: var(--muted); }
.plan-trial { background: rgba(217,119,87,0.12); color: var(--accent); border-color: rgba(217,119,87,0.30); }
.plan-pro   { background: rgba(217,119,87,0.14); color: var(--accent); border-color: rgba(217,119,87,0.34); }
.user-email {
  font-size: 11px; color: var(--muted); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 4px; margin-bottom: 2px; display: none;
}
.sign-out-btn { color: var(--red) !important; }
.sign-out-btn:hover { border-color: var(--red) !important; background: rgba(201,98,75,0.10) !important; }

/* ── Main ── */
.main { flex: 1; overflow-y: auto; padding: 34px 40px 60px; }
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

h1 { font-family: var(--font-serif); font-size: 32px; font-weight: 400; color: var(--text-strong); margin-bottom: 24px; letter-spacing: -.5px; }

.view { display: none; }
.view.active { display: block; }

/* ── KPI ── */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 32px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.kpi span { display: block; font-family: var(--font-serif); font-size: 30px; font-weight: 400; line-height: 1.05; color: var(--accent); }
.kpi.drop span { color: var(--green); }
.kpi.up   span { color: var(--red); }
.kpi label {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-top: 8px; display: block;
}

.section-title {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px;
}

/* ── Recent changes ── */
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px; cursor: pointer; transition: background .12s, border-color .12s;
}
.recent-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.rdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rname { flex: 1; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rprice { font-size: 14px; font-weight: 700; color: var(--accent); }
.rchange { font-size: 12px; margin-left: 6px; font-weight: 600; }
.rchange.down { color: var(--green); }
.rchange.up   { color: var(--red); }
.rchange.flat { color: var(--muted); }
.rchange.new  { color: var(--accent); font-size: 11px; background: rgba(217,119,87,0.14); padding: 2px 8px; border-radius: 999px; }

/* ── View header ── */
.view-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.view-header h1 { margin-bottom: 0; }
.search {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); padding: 10px 15px; font: inherit; font-size: 14px; width: 260px; outline: none;
  transition: border-color .15s;
}
.search:focus { border-color: var(--accent); }
.search::placeholder { color: var(--muted); }

/* ── Status filtre göstergesi ── */
.status-filter-indicator {
  display: flex; align-items: center; gap: 10px;
  background: rgba(63,124,184,0.12); border: 1px solid rgba(63,124,184,0.32);
  border-radius: var(--radius); padding: 9px 15px; margin-bottom: 14px;
  font-size: 13px; font-weight: 600; color: var(--blue);
}
.sfi-clear {
  margin-left: auto; background: none; border: 1px solid rgba(63,124,184,0.4);
  color: var(--blue); border-radius: 999px; padding: 3px 11px;
  cursor: pointer; font-size: 12px; transition: background .15s;
}
.sfi-clear:hover { background: rgba(63,124,184,0.14); }

/* ── Filters ── */
.filter-row { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.filter {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); cursor: pointer; font: inherit; font-size: 13.5px;
  font-weight: 600; transition: background .15s, color .15s, border-color .15s;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Product table ── */
.product-table { display: flex; flex-direction: column; gap: 8px; }
.pt-row {
  display: grid; grid-template-columns: 26px 1fr 120px 80px 90px 90px 40px;
  align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px; cursor: pointer; transition: background .12s, border-color .12s;
}
.pt-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pt-dot { width: 11px; height: 11px; border-radius: 50%; }
.pt-name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-price { font-size: 15px; font-weight: 700; color: var(--accent); text-align: right; }
.pt-change { font-size: 13px; text-align: right; }
.pt-change.down { color: var(--green); }
.pt-change.up   { color: var(--red); }
.pt-platform { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.pt-eklenme { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pt-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 20px; text-align: center; transition: color .15s; }
.pt-del:hover { color: var(--red); }

/* ── Alarm list ── */
.hint { font-size: 14px; color: var(--sub); margin-bottom: 18px; line-height: 1.7; }
.alarm-list { display: flex; flex-direction: column; gap: 9px; }
.alarm-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 16px; cursor: pointer; transition: background .12s, border-color .12s;
}
.alarm-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.alarm-info { flex: 1; }
.alarm-name { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.alarm-detail { font-size: 12px; color: var(--muted); }
.alarm-price { font-size: 15px; font-weight: 700; color: var(--accent); }
.alarm-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(217,119,87,0.14); color: var(--accent);
}
.alarm-actions { display: flex; gap: 6px; margin-left: 4px; }
.alarm-edit, .alarm-del {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 12px; padding: 5px 9px;
  transition: border-color .15s, color .15s;
}
.alarm-edit:hover { border-color: var(--accent); color: var(--accent); }
.alarm-del:hover  { border-color: var(--red); color: var(--red); }

/* ── Chart header / range buttons ── */
.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.chart-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.range-btns { display: flex; gap: 4px; }
.range-btn {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 12px;
  transition: background .15s, color .15s, border-color .15s;
}
.range-btn:hover { border-color: var(--border-strong); color: var(--text); }
.range-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Son güncelleme ── */
.pt-guncelleme { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── Detail panel ── */
.detail-panel {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.detail-panel.hidden { display: none; }
.detail-inner {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 34px; width: 760px; max-width: 95vw; max-height: 90vh;
  overflow-y: auto; position: relative; box-shadow: var(--shadow);
}
.detail-close {
  position: absolute; top: 18px; right: 20px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); font-size: 16px; cursor: pointer;
}
.detail-close:hover { background: var(--surface); }
.detail-header { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; padding-right: 40px; }
.detail-gorsel {
  width: 100px; height: 100px; object-fit: contain; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0;
}
.detail-gorsel.hidden { display: none; }
.detail-header-text { flex: 1; min-width: 0; }
.detail-inner h2 { font-family: var(--font-serif); font-size: 25px; font-weight: 400; color: var(--text-strong); margin-bottom: 6px; line-height: 1.3; }
.detail-meta { font-size: 13px; color: var(--muted); }
#priceChart { width: 100%; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 22px; }

.form-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.form-row label { font-size: 13px; color: var(--sub); width: 170px; flex-shrink: 0; }
.form-row input, .form-row select {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); padding: 9px 13px; font: inherit; font-size: 14px; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--accent); }
.form-row select option { background: var(--surface); color: var(--text); }

#saveAlarm {
  padding: 10px 22px; border-radius: 999px; background: var(--accent); color: #fff;
  border: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; transition: opacity .15s;
}
#saveAlarm:hover { opacity: .9; }

.btn-visit {
  display: inline-block; margin-right: 14px; color: var(--accent);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn-visit:hover { text-decoration: underline; }
.btn-remove-product {
  color: var(--red); background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 0; transition: opacity .15s;
}
.btn-remove-product:hover { opacity: .75; }

.empty-state { padding: 48px; text-align: center; color: var(--muted); line-height: 1.8; font-size: 14px; }

/* ── Fiyat Bandı ── */
.price-band-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin: 14px 0;
}
.price-band-item {
  background: var(--surface); border-radius: var(--radius); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border);
}
.band-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.band-val   { font-size: 17px; font-weight: 700; }
.band-min .band-val { color: var(--green); }
.band-avg .band-val { color: var(--sub); }
.band-max .band-val { color: var(--red); }
.band-cur .band-val { color: var(--accent); }

/* ── Pazar Derinliği ── */
.sellers-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sellers-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.sellers-sub { font-size: 12px; color: var(--muted); flex: 1; }
.sellers-refresh { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 16px; padding: 3px 9px; transition: color .15s, border-color .15s; }
.sellers-refresh:hover { color: var(--accent); border-color: var(--accent); }
.sellers-loading { font-size: 13px; color: var(--muted); padding: 12px 0; }
.sellers-empty   { font-size: 13px; color: var(--muted); padding: 12px 0; }
.sellers-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sellers-table th { text-align: left; color: var(--muted); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 8px; border-bottom: 1px solid var(--border); }
.sellers-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.sellers-table tr:last-child td { border-bottom: none; }
.sellers-table tr.seller-best td { background: rgba(91,154,107,0.10); }
.seller-rank { color: var(--muted); font-size: 12px; width: 24px; }
.seller-name { font-weight: 600; }
.seller-name a { color: var(--text); text-decoration: none; }
.seller-name a:hover { color: var(--accent); }
.seller-price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.seller-price.cheapest { color: var(--green); }
.seller-stock { color: var(--sub); font-size: 12px; }
.seller-score { font-size: 12px; }
.seller-score.high { color: var(--green); }
.seller-score.mid  { color: var(--amber); }
.seller-score.low  { color: var(--red); }
.sellers-platform-note { font-size: 12px; color: var(--muted); padding: 8px 0; font-style: italic; }

/* ── Hesap bölümleri (kartlar) ── */
.calc-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 14px;
}
.calc-section h3 { font-size: 15px; font-weight: 600; color: var(--text-strong); margin-bottom: 16px; }

.buybox-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.buybox-stat {
  flex: 1; background: var(--surface-2); border-radius: var(--radius); padding: 13px 16px;
  border: 1px solid var(--border);
}
.buybox-stat.highlight { border-color: rgba(217,119,87,0.4); background: rgba(217,119,87,0.10); }
.bb-label {
  display: block; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.bb-val { font-size: 21px; font-weight: 700; color: var(--accent); }
.buybox-stat.highlight .bb-val { color: var(--green); }
.buybox-arrow { color: var(--muted); font-size: 20px; flex-shrink: 0; }
.calc-hint { font-size: 12px; color: var(--sub); line-height: 1.65; }

.karlilik-sonuc {
  margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.karl-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--sub);
}
.karl-row span:last-child { font-weight: 600; color: var(--text); }
.karl-row .red { color: var(--red); }
.karl-row.total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.karl-row.total span { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.karl-row.total span:last-child { color: var(--accent); }
.karl-row.total span:last-child.loss { color: var(--red); }

/* ── Hakkında ── */
.about-card {
  max-width: 680px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 36px;
}
.about-logo {
  font-family: var(--font-serif); font-size: 30px; font-weight: 400; color: var(--text-strong); margin-bottom: 4px;
}
.about-logo span { color: var(--accent); }
.about-version { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.about-desc { font-size: 14px; color: var(--sub); line-height: 1.7; margin-bottom: 28px; }

.about-features { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.about-feature {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px;
}
.af-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.about-feature strong { display: block; font-size: 14px; color: var(--text-strong); margin-bottom: 3px; }
.about-feature p { font-size: 13px; color: var(--sub); line-height: 1.55; margin: 0; }

.about-platforms {
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  margin-bottom: 28px;
}
.about-plat { font-size: 13px; font-weight: 600; }

.about-links {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.about-links a {
  font-size: 13px; color: var(--accent); font-weight: 600; text-decoration: none;
  transition: opacity .15s;
}
.about-links a:hover { opacity: .75; text-decoration: underline; }

.about-footer {
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.about-footer strong { color: var(--sub); }
.about-footer-line { line-height: 1.6; }

.about-onenly {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-2); border-radius: var(--radius); padding: 14px 18px;
  border: 1px solid var(--border); margin-bottom: 4px;
}
.onenly-logo { height: 44px; width: auto; object-fit: contain; flex-shrink: 0; border-radius: 8px; }
.onenly-name { font-size: 15px; font-weight: 700; color: var(--text-strong); margin-bottom: 3px; }
.onenly-copy { font-size: 12px; color: var(--muted); line-height: 1.55; }
