/* Basic layout for the newsreader app.
   Intentionally lightweight after removing the previous themed styles. */
:root {
    --bg: #f7f7f7;
    --panel: #ffffff;
    --border: #d4d7db;
    --text: #24303e;
    --text-muted: #5b6570;
    --accent: #1a7fd0;
    --accent-soft: rgba(26, 127, 208, 0.08);
    --danger: #c2404b;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

.container-fluid {
    max-width: 1200px;
}

/* Heatmap layout */
#map {
    height: 600px;
    width: 100%;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    box-shadow: 0 14px 40px rgba(9, 14, 43, 0.12);
    border: 1px solid var(--border);
    background: #e9f2fb;
}

.matrix-heatmap-sidebar {
    position: fixed;
    top: 110px;
    right: max(4vw, 32px);
    width: min(360px, 90vw);
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    background: var(--panel);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(16, 34, 63, 0.18);
    display: none;
    z-index: 2000;
}

.matrix-heatmap-sidebar h5 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.matrix-heatmap-sidebar.is-open {
    display: block;
}

.matrix-heatmap-link {
    color: var(--accent);
    font-weight: 500;
}

.matrix-heatmap-link:hover,
.matrix-heatmap-link:focus {
    text-decoration: underline;
}

@media (max-width: 768px) {
    #map {
        height: 420px;
        border-radius: 10px;
    }

    .matrix-heatmap-sidebar {
        position: fixed;
        inset: auto 16px 16px 16px;
        max-height: 60vh;
        width: auto;
    }
}

.matrix-shell {
    padding: 2rem 0 4rem;
}

.matrix-container {
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(30, 40, 50, 0.12);
}

/* Sticky navigation bar */
.matrix-nav {
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(30, 40, 50, 0.08);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}
}

.matrix-nav .navbar-toggler {
    border-color: rgba(36, 48, 62, 0.2);
}

.matrix-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(36,48,62,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-flex {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 992px) {
    .nav-flex {
        flex-direction: row;
        align-items: center;
    }
}

.matrix-title {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.nav-link,
.navbar-text,
.nav-link-text {
    color: var(--text);
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link:focus,
.navbar-text strong {
    color: var(--accent);
}

.theme-toggle-wrapper,
.matrix-overlay,
.matrix-code-bg,
.matrix-rain {
    display: none;
}

.matrix-filters {
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--panel);
    padding: 1rem;
}

.quick-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background-color: #f0f3f7;
}

.quick-filter-btn.is-active {
    border-color: var(--accent);
    color: #fff;
    background-color: var(--accent);
}

.article-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--panel);
}

.article-card .card-body {
    padding: 1.1rem 1.4rem;
}

.article-title-link {
    font-size: 1.05rem;
    font-weight: 600;
    display: inline-block;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.article-original-link {
    color: var(--accent);
}

.score-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.article-body {
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border);
    background-color: var(--panel);
    color: var(--text);
}

.badge.article-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background-color: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
}

.badge.article-source-badge .bi {
    font-size: 1rem;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    color: #fff;
    background-color: var(--danger);
}

.alert {
    border-radius: 6px;
}

.matrix-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.system-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-muted);
}

.system-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background-color: var(--border);
    color: var(--text);
}

.system-status-pill.is-online {
    background-color: var(--accent);
    color: #fff;
}

.system-status-pill.is-offline {
    background-color: var(--danger);
    color: #fff;
}

.system-status-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.article-header {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .article-header {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .matrix-container {
        padding: 1.25rem;
    }

    .article-card .card-body {
        padding: 0.9rem 1.05rem;
    }
}

.matrix-weight-star {
    font-size: 1.2rem;
    transition: color 0.2s ease;
    color: var(--accent);
}

.matrix-weight-negative-strong {
    color: #8b1c2b;
}

.matrix-weight-negative {
    color: #c2404b;
}

.matrix-weight-neutral {
    color: #6c757d;
}

.matrix-weight-positive-light {
    color: #2f9e44;
}

.matrix-weight-positive-mid {
    color: #1b7f6b;
}

.matrix-weight-positive-strong {
    color: #0b7285;
}
