/* Signal Radar — Light theme, clean data-focused design */
:root {
    --bg: #f8f9fc;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f8;
    --border: #e2e5ef;
    --text: #1a1a2e;
    --text-dim: #5a6072;
    --text-faint: #9098ad;
    --accent: #4f5bd5;
    --accent-glow: #4f5bd533;
    --green: #0d9668;
    --red: #dc2626;
    --amber: #d97706;
    --purple: #7c3aed;
    --pink: #db2777;
    --cyan: #0891b2;
    --radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: rgba(248, 249, 252, 0.92);
    z-index: 100;
    backdrop-filter: blur(12px);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav { display: flex; gap: 24px; }
nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
nav a:hover, nav a.active { color: var(--text); }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.85rem;
}
.site-footer .updated { margin-top: 4px; font-size: 0.8rem; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(79,91,213,0.08); }
.card a { color: var(--text); text-decoration: none; }

/* Grid */
.grid {
    display: grid;
    gap: 16px;
}
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Stats bar */
.stats-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    flex: 1;
    min-width: 140px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-green { background: #0d966815; color: var(--green); }
.badge-red { background: #dc262615; color: var(--red); }
.badge-amber { background: #d9770615; color: var(--amber); }
.badge-blue { background: #4f5bd515; color: var(--accent); }
.badge-purple { background: #7c3aed15; color: var(--purple); }
.badge-pink { background: #db277715; color: var(--pink); }

/* Growth items */
.growth-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.growth-item:hover { background: var(--bg-hover); }
.growth-item:last-child { border-bottom: none; }
.growth-name { font-weight: 500; }
.growth-meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
.growth-stats { display: flex; gap: 12px; align-items: center; }
.growth-change {
    font-weight: 600;
    font-size: 0.9rem;
}
.growth-change.positive { color: var(--green); }
.growth-change.negative { color: var(--red); }

/* Entity pills */
.entity-pill {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all 0.2s;
}
.entity-pill:hover { border-color: var(--accent); background: var(--bg-hover); }
.entity-pill a { color: var(--text); text-decoration: none; }
.entity-pill .count { color: var(--text-faint); margin-left: 4px; font-size: 0.7rem; }

/* Section */
.section-header {
    margin-bottom: 24px;
}
.section-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.section-header p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.data-table tr:hover { background: var(--bg-hover); }

/* Sparkline */
.sparkline { display: inline-block; vertical-align: middle; }

/* Page hero */
.hero {
    padding: 40px 0 30px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}
.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.hero .tagline {
    font-size: 1.1rem;
    color: var(--text-dim);
}

/* Entity search */
.entity-search-box {
    margin-bottom: 28px;
}
.entity-search-box input {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.entity-search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.entity-search-box input::placeholder {
    color: var(--text-faint);
}

/* Entity detail page */
.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 16px;
    transition: opacity 0.2s;
}
.back-link:hover { opacity: 0.8; }

.entity-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.entity-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.entity-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.entity-type-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.entity-type-person { background: #4f5bd515; color: var(--accent); }
.entity-type-organization { background: #7c3aed15; color: var(--purple); }
.entity-type-location { background: #0d966815; color: var(--green); }
.entity-type-technology { background: #0891b215; color: var(--cyan); }
.entity-type-political_party { background: #d9770615; color: var(--amber); }
.entity-type-podcast_host { background: #db277715; color: var(--pink); }
.entity-type-podcast_guest { background: #db277715; color: var(--pink); }
.entity-mention-count {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
}

.entity-section {
    margin-bottom: 36px;
}
.entity-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Co-occurring pills */
.co-occurring-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 2.2;
}
.co-pill {
    text-decoration: none;
    color: var(--text);
}
.co-pill:hover {
    border-color: var(--accent);
}

/* Mentions */
.mentions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mention-item {
    padding: 14px 18px;
}
.mention-header {
    margin-bottom: 8px;
}
.mention-title {
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 4px;
}
a.mention-title:hover { color: var(--accent); }
.mention-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}
.source-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}
.source-news { background: #4f5bd515; color: var(--accent); }
.source-podcast { background: #db277715; color: var(--pink); }
.source-frontpage { background: #0d966815; color: var(--green); }
.mention-source { color: var(--text-dim); }
.mention-date { color: var(--text-faint); }
.mention-snippet {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

/* Article list */
.articles-list {
    padding: 0;
}
.article-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.article-item:hover { background: var(--bg-hover); }
.article-item:last-child { border-bottom: none; }
.article-title {
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
a.article-title:hover { color: var(--accent); }
.article-meta {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-bar { flex-direction: column; }
    nav { gap: 16px; }
    .hero h1 { font-size: 1.5rem; }
}
