/* Crypto & Deriv Tracker Pro — estilos principais (extraído do index.html no PR #6) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --secondary: #1e293b;
    --bg-dark: #090d16;
    --panel-bg: #131c2e;
    --border-color: #293548;
    --accent: #0ea5e9;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-soft: #cbd5e1;
    --surface-0: #060911;
    --surface-1: #090d16;
    --surface-2: #0f172a;
    --surface-3: #1e293b;
    --bg-grad-top: #172033;
}

:root[data-theme="light"] {
    --bg-dark: #eef2f7;
    --panel-bg: #ffffff;
    --border-color: #cbd5e1;
    --secondary: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-soft: #475569;
    --surface-0: #e2e8f0;
    --surface-1: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --bg-grad-top: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: radial-gradient(circle at top, var(--bg-grad-top) 0%, var(--bg-dark) 100%);
    color: var(--text-main);
    min-height: 100vh;
}

/* Barra Superior Ticker Tape + Sentimento Global */
.top-ticker-bar {
    background: var(--surface-0);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: nowrap;
}

.ticker-items {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-soft);
    font-weight: 600;
}

.ticker-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.35);
}

header {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.14) 0%, rgba(14, 165, 233, 0.12) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.15rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand-wrap h1 {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.brand-wrap p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 600;
}

.dot-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 1.8s infinite;
}

.dot-warn {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.container {
    max-width: 1680px;
    margin: 0 auto;
}

/* Layout Terminal Pro em 3 Colunas */
.layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 360px;
    gap: 1.25rem;
    padding: 1.25rem;
    align-items: start;
}

aside, .news-sidebar {
    background: var(--panel-bg);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 14px;
}

aside h2, .news-sidebar h2 {
    color: var(--primary);
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.market-source-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    background: var(--surface-1);
    padding: 0.3rem;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.9rem;
}

.source-tab {
    padding: 0.55rem 0.4rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.source-tab.active {
    background: var(--primary);
    color: #fff;
}

.search-box {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.search-box input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.88rem;
}

.search-box button {
    padding: 0 0.95rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.pair-label {
    color: var(--text-muted);
    font-size: 0.76rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pair-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.pair-option {
    padding: 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-1);
    color: var(--text-soft);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
}

.pair-option.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.quick-btn {
    padding: 0.5rem;
    background: var(--surface-3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.76rem;
    transition: 0.15s;
}

.quick-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}

.crypto-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 430px;
    overflow-y: auto;
}

.crypto-card {
    padding: 0.75rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s;
}

.crypto-card:hover {
    border-color: #64748b;
}

.crypto-card.active {
    background: rgba(249, 115, 22, 0.16);
    border-color: var(--primary);
}

.asset-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.35rem;
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    font-weight: 700;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.66rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    margin-left: 0.4rem;
}

.auth-badge.official {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.auth-badge.proxy {
    background: rgba(14, 165, 233, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.4);
}

.auth-badge.fallback {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

main {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    min-width: 0;
}

.price-banner {
    background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    padding: 1.15rem 1.35rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.price-main h2 {
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.15rem 0;
    font-variant-numeric: tabular-nums;
}

.kpis-row {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.kpi-box {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    min-width: 110px;
}

.kpi-box small {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.kpi-box strong {
    font-size: 0.9rem;
    color: var(--text-main);
}

.chart-card, .analysis-card {
    background: var(--panel-bg);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.card-title {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeframe-group {
    display: flex;
    gap: 0.35rem;
}

.tf-btn {
    padding: 0.35rem 0.65rem;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.tf-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.chart-container {
    position: relative;
    height: 340px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-1);
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.badge {
    padding: 0.85rem;
    border-radius: 8px;
    text-align: center;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
}

.badge strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.badge small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.badge.COMPRAR {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.45);
    color: #4ade80;
}

.badge.VENDER {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.badge.AGUARDAR {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fbbf24;
}

.reasoning {
    background: var(--surface-1);
    padding: 0.95rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-soft);
}

.ai-badge {
    display: inline-block;
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.4);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.volatility-banner {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.9rem;
    font-size: 0.78rem;
    line-height: 1.4;
}

.volatility-banner strong {
    color: #fbbf24;
    display: block;
    margin-bottom: 0.2rem;
}

.news-filter-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.news-tab {
    flex: 1;
    padding: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--surface-1);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.news-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 680px;
    overflow-y: auto;
}

.news-item {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    transition: border-color 0.15s;
}

.news-item:hover {
    border-color: var(--primary);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
}

.news-tag {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
}

.news-tag.BULL { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.news-tag.BEAR { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.news-tag.VOLATILE { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.news-tag.NEUTRAL { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }

.news-item a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    display: block;
    margin-bottom: 0.4rem;
}

.news-item a:hover {
    color: var(--primary);
}

.news-advice {
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px dashed #1e293b;
    padding-top: 0.35rem;
}

.seo-hub {
    margin: 0 1.25rem 1.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.seo-box {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
}

.seo-box h3 {
    color: var(--primary);
    font-size: 0.92rem;
    margin-bottom: 0.45rem;
}

.seo-box p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

footer {
    background: var(--surface-0);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

@media (max-width: 1200px) {
    .layout {
        grid-template-columns: 280px 1fr;
    }
    .news-sidebar {
        grid-column: 1 / -1;
        position: static;
    }
    .seo-hub {
        grid-template-columns: 1fr;
    }
}

/* PR #7 — Análise de dígitos Deriv */
.digit-cell{background:var(--surface-1);border:1px solid var(--border-color);border-radius:10px;padding:.5rem;text-align:center;display:grid;gap:.2rem}
.digit-cell strong{font-size:1.1rem;color:var(--text-main)}.digit-cell span{font-size:.8rem;color:#38bdf8;font-weight:700}
.digit-cell small{color:#94a3b8;font-size:.65rem}.digit-bar{height:6px;background:var(--surface-3);border-radius:4px;overflow:hidden}
.digit-bar i{display:block;height:100%;background:#38bdf8}

/* PR #11 — ajustes finos do tema claro */
:root[data-theme="light"] body { background: radial-gradient(circle at top, #ffffff 0%, #eef2f7 100%); }
:root[data-theme="light"] input, :root[data-theme="light"] select { background: var(--surface-1); color: var(--text-main); border-color: var(--border-color); }
:root[data-theme="light"] .simulator-card, :root[data-theme="light"] .analysis-card, :root[data-theme="light"] .chart-card { box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08); }

/* PR #12 — correções de contraste do tema claro (a partir de prints em produção) */
:root[data-theme="light"] .badge.COMPRAR { background: rgba(34,197,94,.22); color: #15803d; }
:root[data-theme="light"] .badge.VENDER { background: rgba(239,68,68,.20); color: #b91c1c; }
:root[data-theme="light"] .badge.AGUARDAR { background: rgba(245,158,11,.24); color: #b45309; }
:root[data-theme="light"] .news-tag.BULL { color: #15803d; }
:root[data-theme="light"] .news-tag.BEAR { color: #b91c1c; }
:root[data-theme="light"] .news-tag.VOLATILE { color: #b45309; }
:root[data-theme="light"] .news-tag.NEUTRAL { color: #0369a1; }
:root[data-theme="light"] .quick-btn { color: var(--text-soft); }
:root[data-theme="light"] .status-pill { color: var(--text-soft); }
:root[data-theme="light"] #theme-toggle { color: var(--text-main); font-weight: 700; }
:root[data-theme="light"] .tf-btn { color: var(--text-soft); }
:root[data-theme="light"] .tf-btn.active { color: #fff; }
:root[data-theme="light"] input::placeholder { color: #94a3b8; }
:root[data-theme="light"] .pair-option.active, :root[data-theme="light"] .tf-btn.active,
:root[data-theme="light"] .source-tab.active { background: #c2410c; border-color: #c2410c; color: #fff; }

/* PR #13 — contorno de destaque em todos os cards de conteúdo.
   Claro: preto (pedido do usuário). Escuro: cinza-azulado visível sobre fundo escuro. */
:root { --card-border: #475569; }
:root[data-theme="light"] { --card-border: #000000; }
aside, .news-sidebar, .price-banner, .chart-card, .analysis-card, .seo-box, .crypto-card {
    border: 1.5px solid var(--card-border);
}
