/* ═══════════════════════════════════════════════
   STRATEGIES PAGE
   ═══════════════════════════════════════════════ */

/* ── Page Header ── */
.page-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-12) 0 var(--sp-10);
}

.page-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--c-teal);
  margin-bottom: var(--sp-3);
}

.page-header h1 {
  margin-bottom: var(--sp-2);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}

.page-header__sub {
  color: var(--c-text-2);
  max-width: 52ch;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap svg {
  position: absolute;
  left: var(--sp-4);
  color: var(--c-muted);
  pointer-events: none;
}

#strat-search {
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--c-text);
  width: 260px;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
#strat-search::placeholder { color: var(--c-muted); }
#strat-search:focus { outline: none; border-color: var(--c-teal); box-shadow: 0 0 0 3px var(--c-teal-light); }

/* ── Toolbar ── */
.strat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding: var(--sp-6) 0;
}

.filter-group {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.filter-group input[type="radio"] { display: none; }

.filter-group label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.45rem 1rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.filter-group label:hover { border-color: var(--c-teal); color: var(--c-text); }

.filter-group__logo {
  display: inline-block;
  background-color:white;
  height: 16px;
  border-color: black;
  border-radius: 8px;
  border-width: 1px;
  border-style: solid;
  position: relative;
  top: -1px;
}

.filter-group input[type="radio"]:checked + label {
  background: var(--c-teal);
  border-color: var(--c-teal);
  color: #0a2222;
  font-weight: 600;
}

/* Sort controls */
.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.sort-label {
  font-size: 0.8125rem;
  color: var(--c-muted);
  white-space: nowrap;
}

.sort-btns {
  display: flex;
  gap: var(--sp-1);
}

.sort-btn {
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--t-fast) var(--ease-out);
}

.sort-btn:hover { border-color: var(--c-teal); color: var(--c-teal); }

.sort-btn--active {
  background: var(--c-teal-light);
  border-color: var(--c-teal);
  color: var(--c-teal);
}

/* ── Table ── */
.strat-table-wrap {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  overflow-x: auto;
  margin-bottom: var(--sp-4);
}

.strat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.strat-table thead {
  background: var(--c-surface-2);
  position: sticky;
  z-index: 10;
}

.strat-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.strat-table th.col-active {
  color: var(--c-teal);
}

.strat-table td {
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--c-border-light);
  color: var(--c-text-2);
  white-space: nowrap;
}

.strat-table tr:last-child td { border-bottom: none; }

.strat-table tbody tr {
  transition: background var(--t-fast) var(--ease-out);
}
.strat-table tbody tr:hover { background: var(--c-surface-2); }

/* Hidden rows */
.strat-row.hidden,
.strat-row.search-hidden { display: none; }

/* Logo */
.strat-row__logo {
  display: inline-block;
  background-color:white;
  height: 20px;
  border-style: solid;
  border-color: black;
  border-radius: 10px;
  border-width: 1px;
  border-style: solid;
  position: relative;
  top: 3px;
}

/* ID */
code.strat-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 6px;
  color: var(--c-muted);
}

/* Strategy name */
.strat-name-cell strong {
  color: var(--c-text);
  font-weight: 600;
}

/* Asset badges */
.asset-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-top: 5px;
}

.badge--crypto  { background: var(--c-teal-light);           color: var(--c-teal); }
.badge--stocks  { background: rgba(235,84,6,0.12);           color: var(--c-orange); }
.badge--forex   { background: rgba(108,99,255,0.12);         color: #6c63ff; }
.badge--multi   { background: rgba(16,185,129,0.12);         color: #10b981; }

/* Type tag */
.type-tag {
  font-size: 0.78rem;
  color: var(--c-muted);
  font-weight: 500;
  position: relative;
  top: -2px;
}

/* PnL cells */
.pnl-cell {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: right;
}

/*.pnl--pos { color: #22c55e; }
.pnl--neg { color: var(--c-orange); }*/

.pnl-highlight {
  position: relative;
  font-weight: 600;
}

.pnl-highlight.pnl--pos {
  color: #22c55e;
  background: rgba(34,197,94,0.15);
}
.pnl-highlight.pnl--neg {
  color: var(--c-orange);
  background: rgba(235,84,6,0.15);
}

/* Winrate / drawdown */
.winrate {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--c-text-2);
  display: none;
}

.drawdown {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--c-orange);
  display: none;
}

/* Inline buttons */
.deploy-btn {
  display: block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--t-fast) var(--ease-out);
}

.deploy-btn:hover { border-color: var(--c-teal); color: var(--c-teal); }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-badge--active  { background: rgba(34,197,94,.12); color:#22c55e; }
.status-badge--active::before  { background: #22c55e; }
.status-badge--paused  { background: rgba(251,191,36,.2); color:#fbbf24; }
.status-badge--paused::before  { background: #fbbf24; }
.status-badge--beta    { background: rgba(108,99,255,.12); color:#6c63ff; }
.status-badge--beta::before    { background: #6c63ff; }
.status-badge--stopped { background: rgba(255,255,255,.08); color:var(--c-muted); }
.status-badge--stopped::before { background: var(--c-muted); }

/* Footnote */
.strat-footnote {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--c-muted);
  padding: var(--sp-4) 0 var(--sp-10);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .page-header__inner { flex-direction: column; align-items: flex-start; }
  #strat-search { width: 100%; }
  .search-wrap { width: 100%; }
  .strat-toolbar { flex-direction: column; align-items: flex-start; }
  .filter-group {
    display: block;
    white-space: nowrap;
    max-width: 90vw;
    overflow-x: auto;
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    scrollbar-width: none;  /* Firefox, Safari 18.2+, Chromium 121+ */
  }
}
