/* ── Demo page layout ───────────────────────────────────────── */
.demo-container { padding: 100px 0 4rem; }

.demo-header { text-align: center; margin-bottom: 2rem; }
.demo-title  { font-size: clamp(1.6rem,4vw,2.4rem); font-weight: 800; color: #e4e4e7; margin: 0 0 0.5rem; }
.demo-subtitle { color: #a1a1aa; font-size: 1rem; margin: 0; }

/* scan counter badge */
.scan-counter {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #18181b; border: 1px solid #27272a;
    border-radius: 99px; padding: 0.35rem 1rem;
    font-size: 0.82rem; color: #a1a1aa; margin-top: 0.75rem;
}
.scan-counter .dots { display: flex; gap: 5px; }
.scan-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #27272a; border: 1px solid #3f3f46;
    transition: background 0.3s, border-color 0.3s;
}
.scan-dot.used { background: #8b5cf6; border-color: #8b5cf6; }

/* ── Search bar ─────────────────────────────────────────────── */
.demo-search-wrap {
    background: #18181b; border: 1px solid #27272a; border-radius: 16px;
    padding: 1.5rem; margin-bottom: 1.5rem;
}
.search-row {
    display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end;
}
.search-field { flex: 1; min-width: 200px; position: relative; }
.search-field label {
    display: block; font-size: 0.78rem; color: #71717a;
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem;
}
.search-input-wrap { position: relative; }
.search-input-wrap input {
    width: 100%; background: #09090b; border: 1px solid #27272a; border-radius: 8px;
    color: #e4e4e7; padding: 0.65rem 2.5rem 0.65rem 0.85rem;
    font-size: 0.95rem; outline: none; transition: border-color 0.2s; box-sizing: border-box;
}
.search-input-wrap input:focus { border-color: #8b5cf6; }
.search-clear {
    position: absolute; right: 0.65rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #52525b; cursor: pointer; font-size: 1rem;
    display: none; padding: 0; line-height: 1;
}

/* autocomplete dropdown */
.autocomplete-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
    background: #18181b; border: 1px solid #3f3f46; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5); max-height: 260px; overflow-y: auto;
}
.autocomplete-item {
    padding: 0.6rem 0.9rem; cursor: pointer; display: flex;
    align-items: center; justify-content: space-between; gap: 0.5rem;
}
.autocomplete-item:hover { background: #27272a; }
.ac-symbol { font-weight: 600; color: #e4e4e7; font-size: 0.9rem; }
.ac-name   { color: #71717a; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ac-exch   { color: #52525b; font-size: 0.72rem; flex-shrink: 0; }

/* exchange select */
.exchange-field { min-width: 110px; }
.exchange-field select {
    width: 100%; background: #09090b; border: 1px solid #27272a; border-radius: 8px;
    color: #e4e4e7; padding: 0.65rem 0.85rem; font-size: 0.95rem;
    outline: none; cursor: pointer; appearance: none;
}
.exchange-field select:focus { border-color: #8b5cf6; }

/* timeframe pills */
.tf-field { min-width: 200px; }
.tf-pills  { display: flex; gap: 5px; }
.tf-pill {
    padding: 0.45rem 0.85rem; border-radius: 6px; border: 1px solid #27272a;
    background: transparent; color: #71717a; font-size: 0.82rem; cursor: pointer;
    transition: all 0.15s;
}
.tf-pill:hover  { border-color: #8b5cf6; color: #c4b5fd; }
.tf-pill.active { background: rgba(139,92,246,.15); border-color: #8b5cf6; color: #a78bfa; font-weight: 600; }

.scan-btn {
    padding: 0.65rem 1.8rem; background: linear-gradient(135deg,#8b5cf6,#7c3aed);
    border: none; border-radius: 8px; color: #fff; font-weight: 700; font-size: 0.95rem;
    cursor: pointer; white-space: nowrap; transition: opacity 0.2s;
    display: flex; align-items: center; gap: 0.5rem; height: 42px; align-self: flex-end;
}
.scan-btn:hover:not(:disabled) { opacity: 0.88; }
.scan-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Quick pick chips ───────────────────────────────────────── */
.quick-picks { margin-top: 1rem; }
.quick-label { font-size: 0.75rem; color: #52525b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
    padding: 0.3rem 0.75rem; border-radius: 99px; border: 1px solid #27272a;
    background: #09090b; color: #a1a1aa; font-size: 0.8rem; cursor: pointer;
    transition: all 0.15s;
}
.chip:hover { border-color: #8b5cf6; color: #c4b5fd; background: rgba(139,92,246,.08); }

/* ── Results panel ──────────────────────────────────────────── */
.results-panel {
    background: #18181b; border: 1px solid #27272a; border-radius: 16px;
    overflow: hidden; margin-bottom: 1.5rem;
}
.results-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid #27272a;
}
.results-panel-title {
    font-weight: 700; color: #e4e4e7; font-size: 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.live-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 99px;
    background: rgba(34,197,94,.12); color: #22c55e; border: 1px solid rgba(34,197,94,.2);
}
.source-tag {
    font-size: 0.72rem; color: #52525b; background: #27272a;
    padding: 2px 7px; border-radius: 4px;
}

/* ── Stats row ──────────────────────────────────────────────── */
.stats-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1px; background: #27272a;
}
.stat-cell {
    background: #18181b; padding: 1rem 1.25rem;
    display: flex; flex-direction: column; gap: 0.25rem;
}
.stat-cell-label { font-size: 0.72rem; color: #52525b; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-cell-val   { font-size: 1.25rem; font-weight: 700; color: #e4e4e7; }
.stat-cell-sub   { font-size: 0.8rem; color: #71717a; }
.up   { color: #22c55e !important; }
.down { color: #ef4444 !important; }

/* ── Chart area ─────────────────────────────────────────────── */
.chart-area { padding: 1.25rem; }
.chart-box  { height: 280px; position: relative; }

/* ── AI insights ────────────────────────────────────────────── */
.insights-grid { display: grid; gap: 0.75rem; padding: 1.25rem; }
.insight-card {
    background: #09090b; border: 1px solid #27272a; border-radius: 10px;
    padding: 0.9rem 1rem; display: flex; gap: 0.75rem; align-items: flex-start;
}
.insight-icon-wrap {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(139,92,246,.12); display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.insight-icon-wrap svg { width: 16px; height: 16px; color: #8b5cf6; }
.insight-body { flex: 1; }
.insight-title { font-size: 0.85rem; font-weight: 600; color: #e4e4e7; margin-bottom: 0.2rem; }
.insight-desc  { font-size: 0.8rem; color: #71717a; line-height: 1.5; }

/* ── Empty / loading / error states ─────────────────────────── */
.state-box {
    padding: 3rem 1rem; text-align: center; color: #52525b;
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.state-box svg { width: 36px; height: 36px; opacity: .4; }
.state-box p { margin: 0; font-size: 0.9rem; }
.spinner {
    width: 28px; height: 28px; border: 3px solid #27272a;
    border-top-color: #8b5cf6; border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Signup gate modal ───────────────────────────────────────── */
.gate-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.gate-card {
    background: #18181b; border: 1px solid #8b5cf6; border-radius: 20px;
    padding: 2.5rem 2rem; max-width: 420px; width: 100%; text-align: center;
    position: relative; animation: popIn .2s ease;
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gate-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: #52525b; cursor: pointer; font-size: 1.2rem;
}
.gate-emoji { font-size: 3rem; margin-bottom: 0.75rem; display: block; }
.gate-title { font-size: 1.4rem; font-weight: 800; color: #e4e4e7; margin: 0 0 0.5rem; }
.gate-body  { color: #a1a1aa; font-size: 0.9rem; line-height: 1.6; margin: 0 0 1.75rem; }
.gate-btns  { display: flex; flex-direction: column; gap: 0.75rem; }
.gate-btns .btn-primary { display: block; padding: 0.9rem; font-size: 1rem; text-decoration: none; }
.gate-login { color: #71717a; font-size: 0.85rem; text-decoration: none; }
.gate-login span { color: #8b5cf6; }

@media (max-width: 640px) {
    .demo-container { padding: 80px 0 3rem; }
    .search-row { flex-direction: column; }
    .scan-btn   { width: 100%; justify-content: center; }
    .stat-cell-val { font-size: 1rem; }
}
