/* ---------------------------------------------------------------
   Link Intel - Dark-theme competitive intelligence dashboard
   --------------------------------------------------------------- */

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Competitor accent colors */
    --c-bitly: #ee6123;
    --c-dub: #7c3aed;
    --c-shortio: #10b981;
    --c-tinyurl: #f59e0b;
    --c-rebrandly: #3b82f6;
    --c-sniply: #ec4899;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ---- Header ---- */

header {
    padding: 2.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

/* ---- Stats row ---- */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
}

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

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ---- Filter bar ---- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.filter-btn.active {
    background: var(--accent, var(--text-dim));
    border-color: var(--accent, var(--text-dim));
    color: #fff;
}

/* ---- Sections ---- */

.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ---- Signal cards ---- */

.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.signal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    border-left: 3px solid var(--card-accent, var(--text-dim));
    transition: border-color 0.15s ease;
}

.signal-card:hover {
    border-color: var(--card-accent, var(--text-muted));
}

.signal-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.signal-card .competitor-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--card-accent, var(--text-muted));
}

.signal-card .date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.signal-card .title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

.signal-card .title a {
    color: var(--text);
    text-decoration: none;
}

.signal-card .title a:hover {
    text-decoration: underline;
}

.signal-card .source-tag {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--bg);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* ---- Jobs table ---- */

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

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

tbody td a {
    color: var(--text);
    text-decoration: none;
}

tbody td a:hover {
    text-decoration: underline;
}

.competitor-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ---- Empty state ---- */

.empty-state {
    color: var(--text-dim);
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

/* ---- Footer ---- */

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

footer a {
    color: var(--text-muted);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .signals-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.4rem;
    }
}
