/* ── Alpha Alert – Dark Theme ─────────────────────────────────────────── */

:root {
    --bg: #0d1117;
    --card-bg: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 0 16px 48px;
}

header {
    padding: 32px 0 16px;
    max-width: 960px;
    margin: 0 auto;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

header h1 {
    font-size: 2rem;
    color: var(--accent);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

main {
    max-width: 960px;
    margin: 0 auto;
}

/* Cards */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--accent);
}

/* Stats row */

.stats-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Performance chart */

.perf-chart-container {
    width: 100%;
    height: 200px;
    position: relative;
    margin-bottom: 12px;
}

.perf-chart-container canvas {
    width: 100%;
    height: 100%;
}

.perf-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.perf-stat {
    display: flex;
    flex-direction: column;
}

.perf-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perf-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.perf-positive { color: var(--green); }
.perf-negative { color: var(--red); }

/* Tables */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.empty-msg {
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
}

.loading {
    color: var(--text-muted);
}

/* Watchlist grid */

.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.watch-tile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.watch-tile .ticker {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

.watch-tile .price {
    font-size: 1.25rem;
    margin-top: 4px;
}

/* Action button */

.action-card {
    text-align: center;
}

#subscribe-btn {
    -webkit-appearance: none;
    appearance: none;
    background: var(--accent);
    color: #0d1117;
    border: none;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

#subscribe-btn:hover {
    opacity: 0.85;
}

/* Subscribe Modal */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    position: relative;
}

.modal h2 {
    color: var(--accent);
    margin-bottom: 8px;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
}

#sub-email {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 16px;
}

#sub-email:focus {
    outline: none;
    border-color: var(--accent);
}

.frequency-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.frequency-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-subscribe {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #0d1117;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-subscribe:hover {
    opacity: 0.85;
}

#subscribe-status {
    margin-top: 12px;
    font-size: 0.9rem;
    text-align: center;
}

/* Recommendation cards */

.rec-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 10px;
}

.rec-card .rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.rec-card .decision {
    font-weight: 700;
    text-transform: uppercase;
}

.decision-hold { color: var(--yellow); }
.decision-buy_stock, .decision-buy_call, .decision-buy_put { color: var(--green); }
.decision-sell_stock, .decision-close_position { color: var(--red); }

.rec-card .rec-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rec-card .rec-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.rec-card .reasoning {
    margin-top: 6px;
    font-size: 0.9rem;
}

.pnl-positive { color: var(--green); }
.pnl-negative { color: var(--red); }

/* Footer */

footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer strong {
    color: var(--accent);
}
