/* SignalState Pro - Dark Intelligence Theme */

:root {
    /* Color Palette */
    --bg-dark: #020406;
    --bg-navy: #0d1b2a;
    --card-bg: #162433; /* Slightly lighter navy for cards */
    --text-main: #e0e6ed;
    --text-muted: #94a3b8;
    
    /* Accents */
    --neon-green: #00e676;
    --neon-red: #ff1744;
    --neon-blue: #2979ff;
    
    /* Borders & Glows */
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-green: rgba(0, 230, 118, 0.15);
    --glow-red: rgba(255, 23, 68, 0.15);
}

/* 1. Global Resets */
body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, var(--bg-navy) 0%, var(--bg-dark) 80%);
    background-attachment: fixed; /* Keeps gradient in place while scrolling */
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
}

/* 2. Text Overrides */
h1, h2, h3, h4, h5, h6 { color: #fff; font-weight: 700; }
.text-muted { color: var(--text-muted) !important; }
.text-dark { color: #fff !important; } /* Force dark text classes to white in this theme */

/* 3. Navigation & Footer */
.navbar {
    background-color: rgba(13, 27, 42, 0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.footer {
    background-color: rgba(13, 27, 42, 0.9) !important;
    border-top: 1px solid var(--border-color) !important;
    color: var(--text-muted);
}

/* 4. HUD Cards (Top Stats) */
.hud-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    transition: transform 0.2s ease;
}
.hud-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 5. Market Cards (The Core Grid) */
.market-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Status Borders (Neon Glows) */
.status-border-green {
    border-top: 3px solid var(--neon-green);
    box-shadow: 0 0 15px var(--glow-green);
}
.status-border-red {
    border-top: 3px solid var(--neon-red);
    box-shadow: 0 0 15px var(--glow-red);
    animation: pulse-border 2s infinite;
}

/* Card Sections */
.market-card .card-header, 
.market-card .bg-light,
.market-card .bg-white {
    background-color: var(--card-bg) !important; /* Override Bootstrap lights */
    border-color: var(--border-color) !important;
    color: var(--text-main);
}

.market-card .border-bottom, 
.market-card .border-top {
    border-color: var(--border-color) !important;
}

/* 6. List Items (Sub-candidates) */
.list-group-item {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

/* 7. Form Inputs (Search/Filter) */
.form-control, .form-select, .input-group-text {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: #fff;
}
.form-control:focus, .form-select:focus {
    background-color: rgba(0, 0, 0, 0.4);
    border-color: var(--neon-green);
    color: #fff;
    box-shadow: 0 0 0 0.25rem var(--glow-green);
}

/* 8. Modals */
.modal-content {
    background-color: var(--bg-navy);
    border: 1px solid var(--border-color);
    color: #fff;
}
.modal-header, .modal-footer {
    border-color: var(--border-color);
}
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* 9. Utilities */
.cluster-badge {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 5px var(--glow-red); }
    50% { box-shadow: 0 0 20px var(--glow-red); }
    100% { box-shadow: 0 0 5px var(--glow-red); }
}

/* --- System Status Widget --- */
.status-container {
    cursor: help;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    margin-right: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.status-container:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d; /* Default Grey */
    display: inline-block;
}

/* Animations */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.pulse-slow {
    animation: pulse-green 2s infinite;
}

.pulse-fast {
    animation: pulse-red 1s infinite;
}
