/* Trade Finder — premium page styles */

/* ── Page layout ─────────────────────────────────────────── */
.tf-page { background: #f1f5f9; min-height: 100vh; padding-bottom: 32px; }

.tf-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 28px 0 24px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.tf-hero-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.tf-hero h1 {
    font-size: 1.5rem; font-weight: 900; color: #f1f5f9;
    letter-spacing: -.02em; margin: 0 0 4px;
}
.tf-hero-sub { font-size: .82rem; color: #94a3b8; }
.tf-hero-meta { font-size: .72rem; color: #64748b; margin-top: 6px; }
.tf-hero-meta strong { color: #cbd5e1; }

.tf-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px 48px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) { .tf-body { grid-template-columns: 1fr; } }

/* ── Filter panel ─────────────────────────────────────────── */
.sf-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    position: sticky;
    top: 70px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.sf-panel-header {
    background: #0f172a;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sf-panel-header-title {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: #94a3b8;
}
.sf-panel-body { padding: 16px 18px; }
.sf-section-label {
    font-size: .6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: #94a3b8; margin-bottom: 8px; margin-top: 14px;
}
.sf-section-label:first-child { margin-top: 0; }
.sf-divider { height: 1px; background: #f1f5f9; margin: 14px -18px; }

/* ── Results panel ─────────────────────────────────────────── */
.sf-results-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.sf-results-header {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: #fafbfc;
}
.sf-result-count { font-size: .82rem; font-weight: 700; color: #0f172a; }
.sf-result-count span { color: #3b82f6; }
.sf-result-sub { font-size: .72rem; color: #94a3b8; }
.sf-results-body { padding: 16px 18px; }

/* ── Sort bar ─────────────────────────────────────────────── */
.sc-sort-bar {
    display: flex; align-items: center; gap: 5px; margin-bottom: 14px;
    flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9;
}
.sc-sort-label {
    font-size: .6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .09em; color: #94a3b8; margin-right: 4px;
}
.sc-sort-btn {
    font-size: .72rem; padding: 4px 11px; border-radius: 20px;
    border: 1px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer;
    transition: all .12s; font-weight: 600;
}
.sc-sort-btn:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }
.sc-sort-btn.active { background: #0f172a; color: #f1f5f9; border-color: #0f172a; }

/* ── Setup cards ─────────────────────────────────────────── */
#setupsTableBody { display: flex; flex-direction: column; gap: 10px; }
.sc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    transition: box-shadow .15s, border-color .15s, transform .1s;
    cursor: default;
}
.sc-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.09);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.sc-card.sc-urgent { border-left: 3px solid #16a34a; padding-left: 16px; }

/* Card top row */
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 12px; }
.sc-left { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sc-ticker { font-size: 1.1rem; font-weight: 900; color: #0f172a; letter-spacing: -.01em; }
.sc-ticker-filter { cursor: pointer; border-radius: 5px; padding: 0 4px; margin: 0 -4px; transition: background .1s, color .1s; }
.sc-ticker-filter:hover { background: #eff6ff; color: #3b82f6; }
.sc-clickable { cursor: pointer; transition: opacity .12s; }
.sc-clickable:hover { opacity: .75; }
.sc-dir-badge { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; letter-spacing: .02em; }
.sc-dir-badge.long  { background: #dcfce7; color: #15803d; }
.sc-dir-badge.short { background: #fee2e2; color: #dc2626; }
.sc-dir-badge.sc-locked-dir { cursor: pointer; opacity: .55; }
.sc-dir-badge.sc-locked-dir:hover { opacity: .8; }
.sc-event-cat  { font-size: .68rem; padding: 2px 8px; border-radius: 20px; background: #f1f5f9; color: #64748b; font-weight: 600; }
.sc-event-name { font-size: .88rem; color: #0f172a; font-weight: 700; }

/* Entry date (right side) */
.sc-right { text-align: right; flex-shrink: 0; }
.sc-entry-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; font-weight: 700; }
.sc-entry-date { font-size: .9rem; font-weight: 800; color: #0f172a; }
.sc-entry-countdown { font-size: .7rem; color: #94a3b8; }
.sc-entry-countdown.soon { color: #16a34a; font-weight: 700; }

/* Trade description */
.sc-trade-desc { font-size: .8rem; color: #64748b; margin-bottom: 12px; font-style: italic; line-height: 1.45; }

/* Metrics row */
.sc-metrics {
    display: flex;
    gap: 0;
    align-items: stretch;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
}
.sc-metric {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    border-right: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.sc-metric:last-of-type { border-right: none; }
.sc-metric-val { font-size: 1rem; font-weight: 800; color: #0f172a; line-height: 1; letter-spacing: -.01em; }
.sc-metric-val.green { color: #16a34a; }
.sc-metric-val.red   { color: #dc2626; }
.sc-metric-lbl { font-size: .58rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: 3px; }

/* Analyze button */
.sc-analyze-btn {
    background: #0f172a; color: #f1f5f9; font-size: .75rem; font-weight: 700;
    padding: 8px 16px; border-radius: 0;
    text-decoration: none; transition: background .12s; white-space: nowrap;
    display: flex; align-items: center; gap: 5px;
    border-left: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}
.sc-analyze-btn:hover { background: #1e293b; color: #f1f5f9; }

/* ── Edge score badges ───────────────────────────────────── */
.edge-score-excellent { background: #dcfce7; font-weight: 800; color: #15803d; padding: 2px 8px; border-radius: 20px; font-size: .72rem; }
.edge-score-good      { background: #fef9c3; font-weight: 800; color: #a16207; padding: 2px 8px; border-radius: 20px; font-size: .72rem; }
.edge-score-poor      { background: #fee2e2; font-weight: 800; color: #b91c1c; padding: 2px 8px; border-radius: 20px; font-size: .72rem; }

/* ── Sector filter chips ─────────────────────────────────── */
.sector-btn {
    font-size: .65rem; font-weight: 700; padding: 3px 11px;
    border-radius: 999px; border: 1px solid #e2e8f0;
    background: #fff; color: #64748b; cursor: pointer;
    transition: all .12s; white-space: nowrap;
    letter-spacing: .04em; text-transform: uppercase;
}
.sector-btn:hover { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.sector-btn.active { background: #0f172a; color: #f1f5f9; border-color: #0f172a; font-weight: 700; }

/* ── Locked tier styling ─────────────────────────────────── */
.sc-card.sc-locked { background: #f8fafc; border-color: #e2e8f0; }
.sc-card.sc-locked .sc-metrics { background: #f1f5f9; }
.sc-card.sc-locked:hover { cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,.08); }

/* Ticker blur wrapper — dark frosted-glass pill */
.sc-ticker-blur-wrap {
    display: inline-flex; align-items: center;
    position: relative; border-radius: 6px; overflow: hidden;
    background: rgba(15,23,42,.85); backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); padding: 2px 9px; gap: 5px;
}
/* Blurred placeholder text — real ticker never in the DOM */
.sc-ticker-blur { filter: blur(5px); user-select: none; pointer-events: none; color: #e2e8f0; font-weight: 900; font-size: .95rem; letter-spacing: .1em; }
/* Small lock icon inside the pill */
.sc-ticker-lock-icon { display: inline-flex; align-items: center; color: rgba(148,163,184,.7); }

/* Unlock button */
.sc-analyze-btn.locked-btn {
    background: #fff; color: #334155; border: 1px solid #e2e8f0; cursor: pointer;
    border-radius: 0; display: inline-flex; align-items: center; gap: 5px;
    font-weight: 600; transition: background .12s, color .12s, border-color .12s;
}
.sc-analyze-btn.locked-btn svg { color: #94a3b8; flex-shrink: 0; transition: color .12s; }
.sc-analyze-btn.locked-btn:hover { background: #0f172a; border-color: #0f172a; color: #fff; }
.sc-analyze-btn.locked-btn:hover svg { color: #94a3b8; }

/* ── Legacy / misc ───────────────────────────────────────── */
.btn-xs {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.5;
}

/* Ticker tag-input box */
.ticker-tag-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 3px 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    cursor: text;
}
.ticker-tag-box:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
}
.ticker-tag-box input {
    border: none;
    outline: none;
    padding: 0;
    font-size: 0.875rem;
    min-width: 60px;
    flex: 1;
    background: transparent;
    text-transform: uppercase;
}

/* Ticker chip inside the tag-box */
.ticker-tag-box .ticker-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px 1px 8px;
    background: #0d6efd;
    color: #fff;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.6;
}
.ticker-chip-remove { cursor: pointer; font-size: 0.7rem; opacity: 0.8; line-height: 1; }
.ticker-chip-remove:hover { opacity: 1; }

/* Dual-handle range slider */
.dual-range-wrap { position: relative; height: 20px; }
.dual-range {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    pointer-events: none;
    outline: none;
}
.dual-range::-webkit-slider-runnable-track { height: 4px; background: #dee2e6; border-radius: 2px; }
.dual-range::-moz-range-track             { height: 4px; background: #dee2e6; border-radius: 2px; }
.dual-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #0d6efd; border: 2px solid #fff;
    box-shadow: 0 0 0 1px #0d6efd; cursor: pointer;
    pointer-events: all; margin-top: -6px;
}
.dual-range::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: #0d6efd; border: 2px solid #fff;
    box-shadow: 0 0 0 1px #0d6efd; cursor: pointer; pointer-events: all;
}
.dual-range:disabled::-webkit-slider-thumb { background: #adb5bd; box-shadow: 0 0 0 1px #adb5bd; cursor: default; }
.dual-range:disabled::-moz-range-thumb     { background: #adb5bd; box-shadow: 0 0 0 1px #adb5bd; cursor: default; }

.rr-ticks { display: flex; justify-content: space-between; margin-top: 2px; padding: 0 1px; }
.rr-ticks span { font-size: .58rem; color: #94a3b8; text-align: center; width: 0; white-space: nowrap; }

/* Event name tags (used in detail views) */
.event-name-tag {
    display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.4;
    padding: 2px 9px; border-radius: 10px;
    background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe;
    white-space: nowrap; cursor: pointer;
}
.event-name-tag:hover { background-color: #bfdbfe; border-color: #93c5fd; }
.event-name-tag.active-ancestor { background-color: #1d4ed8; border-color: #1d4ed8; color: #fff; }

.event-ancestors { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 4px; }
.event-parents-label { font-size: 10px; color: #9ca3af; margin-right: 2px; white-space: nowrap; }
.event-ancestor-tag {
    font-size: 10px; line-height: 1.4; padding: 1px 7px; border-radius: 10px;
    background-color: #e9ecef; color: #6c757d; border: 1px solid #dee2e6;
    white-space: nowrap; cursor: pointer;
}
.event-ancestor-tag:hover { background-color: #cfe2ff; border-color: #9ec5fe; color: #084298; }
.event-ancestor-tag.active-ancestor { background-color: #0d6efd; border-color: #0d6efd; color: #fff; }
