/* ═══════════════════════════════════════════════════════════
   Polychads Alerts Dashboard — Premium Dark Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Color palette */
    --bg-primary: #0a0b0f;
    --bg-secondary: #12131a;
    --bg-card: #181a24;
    --bg-card-hover: #1e2030;
    --bg-elevated: #222438;

    --text-primary: #e8eaed;
    --text-secondary: #9ba1b0;
    --text-muted: #5c6170;

    --accent-primary: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.25);
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);

    --green: #00e676;
    --green-bg: rgba(0, 230, 118, 0.1);
    --red: #ff5252;
    --red-bg: rgba(255, 82, 82, 0.1);
    --yellow: #ffd740;
    --yellow-bg: rgba(255, 215, 64, 0.08);

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 24px var(--accent-glow);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-live {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-live.disconnected {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(255, 82, 82, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease-in-out infinite;
}

.badge-live.disconnected .pulse-dot {
    background: var(--red);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.header-right {
    display: flex;
    align-items: center;
}

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

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Filters ───────────────────────────────────────────── */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.08);
}

.filter-btn.active {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
    color: var(--text-primary);
}

.filter-select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:focus {
    border-color: var(--accent-primary);
}

/* ── Feed ──────────────────────────────────────────────── */
.feed {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Alert Card ────────────────────────────────────────── */
.alert-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease;
    position: relative;
    overflow: hidden;
}

.alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    border-radius: 3px 0 0 3px;
}

.alert-card.buy::before {
    background: var(--green);
}

.alert-card.sell::before {
    background: var(--red);
}

.alert-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.alert-card.new-alert {
    animation: slideIn 0.4s ease, glowPulse 1.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: var(--shadow-glow); }
    100% { box-shadow: 0 0 0 0 var(--accent-glow); }
}

/* Alert Header */
.alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.alert-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.alert-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.alert-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Alert Body */
.alert-body {
    margin-bottom: 10px;
}

.alert-trade {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.side-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.side-badge.buy {
    background: var(--green-bg);
    color: var(--green);
}

.side-badge.sell {
    background: var(--red-bg);
    color: var(--red);
}

.alert-outcome {
    font-weight: 600;
    color: var(--text-primary);
}

.alert-price {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.alert-market {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.alert-market a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed var(--border);
    transition: color 0.2s;
}

.alert-market a:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.alert-usdc {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Alert Footer */
.alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.alert-signal {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signal-bar {
    display: flex;
    gap: 3px;
}

.signal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-elevated);
    transition: background 0.3s;
}

.signal-dot.filled {
    background: var(--accent-primary);
}

.signal-dot.filled.high {
    background: var(--green);
}

.signal-dot.filled.medium {
    background: var(--yellow);
}

.signal-score {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.alert-wallet {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.alert-wallet a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.alert-wallet a:hover {
    color: var(--accent-primary);
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-state h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.modal h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.modal-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}

.modal-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.modal-btn:active {
    transform: translateY(0);
}

.modal-hint {
    margin-top: 12px;
    font-size: 0.72rem;
    color: var(--text-muted) !important;
    margin-bottom: 0 !important;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .stats-bar {
        gap: 16px;
    }

    .filters-bar {
        flex-direction: column;
        padding: 10px 16px;
    }

    .feed {
        padding: 12px 12px;
    }

    .alert-card {
        padding: 14px 16px;
    }

    .alert-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .alert-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
