/*
  Alpha Signal Desk -- dashboard theme.

  Palette matches the brief exactly: deep black (#0B0E11), dark grey
  surfaces (#1E2329), and the standard exchange green/red pair
  (#0ECB81 / #F6465D) for long/short and up/down.

  Fonts: Vazirmatn ships free via Google Fonts and is used here as the
  practical stand-in for Dana / IranSans (neither is redistributable
  without a purchased license). To switch to a licensed Dana or IranSans
  build instead: drop the woff2 files in assets/fonts/, add an @font-face
  block above the --font-body declaration, and put the family name first
  in the --font-body stack -- nothing else in this file needs to change.
*/

:root{
  --bg: #0B0E11;
  --surface: #1E2329;
  --surface-2: #262B32;
  --border: #2B3139;
  --text: #EAECEF;
  --text-dim: #848E9C;
  --text-faint: #5E6673;
  --long: #0ECB81;
  --long-soft: rgba(14,203,129,0.14);
  --short: #F6465D;
  --short-soft: rgba(246,70,93,0.14);
  --font-body: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*{ box-sizing: border-box; }

.ad-page{
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.ad-page a{ color: inherit; text-decoration: none; }
.ltr{ direction: ltr; unicode-bidi: isolate; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ad-page :focus-visible{ outline: 2px solid var(--long); outline-offset: 2px; }

/* ---------- ticker ---------- */
.ad-ticker{
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 7px 0; overflow: hidden;
}
.ad-live{
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--long);
  padding-inline-start: 18px; padding-inline-end: 14px;
}
.ad-live-dot{ width: 6px; height: 6px; border-radius: 50%; background: var(--long); animation: ad-pulse 1.8s infinite; }
@keyframes ad-pulse{
  0%{ box-shadow: 0 0 0 0 rgba(14,203,129,0.45); }
  70%{ box-shadow: 0 0 0 6px rgba(14,203,129,0); }
  100%{ box-shadow: 0 0 0 0 rgba(14,203,129,0); }
}
.ad-ticker-viewport{ flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.ad-ticker-track{ display: inline-flex; gap: 30px; animation: ad-scroll 30s linear infinite; direction: ltr; }
@keyframes ad-scroll{ from{ transform: translateX(0); } to{ transform: translateX(-50%); } }
.ad-tick{ display: inline-flex; gap: 7px; align-items: baseline; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.ad-tick b{ color: var(--text); font-weight: 600; }
.ad-tick .up{ color: var(--long); }
.ad-tick .down{ color: var(--short); }
@media (prefers-reduced-motion: reduce){ .ad-ticker-track, .ad-live-dot{ animation: none; } }

/* ---------- header / tabs ---------- */
.ad-header{
  max-width: 1100px; margin: 0 auto; padding: 22px 20px 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.ad-brand{ font-weight: 800; font-size: 19px; }
.ad-tabs{ display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 10px; }
.ad-tab{
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-dim);
  background: transparent; border: none; padding: 8px 18px; border-radius: 7px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ad-tab:hover{ color: var(--text); }
.ad-tab.is-active{ background: var(--long); color: #05261b; }

/* ---------- status ---------- */
.ad-status{ max-width: 1100px; margin: 14px auto 0; padding: 0 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.ad-status-chip{
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 100px; padding: 5px 12px; color: var(--text-dim);
}
.ad-status-chip .dot{ width: 6px; height: 6px; border-radius: 50%; }
.ad-status-chip.is-up .dot{ background: var(--long); }
.ad-status-chip.is-down .dot{ background: var(--short); }

/* ---------- calculator ---------- */
.ad-calc{
  max-width: 1100px; margin: 20px auto 0; padding: 0 20px;
}
.ad-calc-head{
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--text-dim); margin-bottom: 8px;
}
.ad-calc-hint{ font-size: 11px; color: var(--text-faint); }
.ad-calc-body{
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end;
}
@media (max-width: 640px){ .ad-calc-body{ grid-template-columns: 1fr; } }
.ad-calc-field{ display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.ad-calc-field input{
  font-family: var(--font-mono); font-size: 15px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; direction: ltr; width: 100%;
}
.ad-calc-field input:focus{ outline: none; border-color: var(--long); }
.ad-calc-result{
  display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-dim);
  background: var(--long-soft); border: 1px solid rgba(14,203,129,0.3); border-radius: 8px; padding: 10px 14px;
}
.ad-calc-result b{ font-size: 18px; color: var(--long); }

/* ---------- table ---------- */
.ad-table-wrap{ max-width: 1100px; margin: 26px auto 0; padding: 0 20px 40px; }
.ad-table-head{
  display: grid; grid-template-columns: 1.1fr 1.1fr 1fr 1.6fr 0.9fr; gap: 10px;
  padding: 10px 16px; font-size: 11.5px; color: var(--text-faint); border-bottom: 1px solid var(--border);
}
.sig-row{
  display: grid; grid-template-columns: 1.1fr 1.1fr 1fr 1.6fr 0.9fr; gap: 10px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  animation: ad-row-in .3s ease both;
}
@keyframes ad-row-in{ from{ opacity: 0; transform: translateY(4px); } to{ opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .sig-row{ animation: none; } }
.sig-row:hover{ background: var(--surface); }
.sig-cell .sym{ font-weight: 600; font-size: 13.5px; }
.sig-cell{ font-size: 13px; color: var(--text-dim); min-width: 0; }
.chip{ display: inline-flex; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.chip.long{ background: var(--long-soft); color: var(--long); }
.chip.short{ background: var(--short-soft); color: var(--short); }
.chip.watch{ background: var(--surface-2); color: var(--text); }
.lvl{ display: inline-flex; gap: 4px; font-size: 12px; margin-inline-end: 10px; color: var(--text-faint); }
.lvl b{ font-weight: 600; color: var(--text); }
.lvl.stop b{ color: var(--short); }
.lvl.tp b{ color: var(--long); }
.muted{ color: var(--text-faint); }
.fresh{ font-size: 12px; color: var(--text-faint); }

@media (max-width: 760px){
  .ad-table-head{ display: none; }
  .sig-row{ grid-template-columns: 1fr; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
  /* Column, not row+space-between: a "levels" cell can hold five tags
     (entry/stop/tp1-3) on a real signal -- on one row those overflow the
     card and force the whole page to scroll sideways. Label above value
     avoids that regardless of how much the value wraps to. */
  .sig-cell{ display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .sig-cell::before{ content: attr(data-label); font-size: 11px; color: var(--text-faint); }
  .sig-cell:first-child::before{ display: none; }
  .sig-cell:first-child .sym{ font-size: 15px; }
  .lvl{ display: inline-block; margin-inline-end: 14px; margin-bottom: 2px; }
}

/* ---------- footer ---------- */
.ad-footer{
  max-width: 1100px; margin: 0 auto; padding: 24px 20px 40px;
  border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.ad-disclaimer{ font-size: 12px; color: var(--text-faint); max-width: 60ch; line-height: 1.7; margin: 0; }
.ad-footer-links{ display: flex; gap: 16px; font-size: 12.5px; color: var(--text-dim); }
.ad-footer-links a:hover{ color: var(--text); }
