/* ═══════════════════════════════════════════════════════════════
   OP DE PLANK - Journalistieke Tool
   Clean, focused design for journalism students
   ═══════════════════════════════════════════════════════════════ */

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

:root {
    --bg: #0f1219;
    --card: #1a1f2e;
    --border: #2d3548;
    --text: #f0f0f0;
    --muted: #8892a4;
    --accent: #d4a853;
    --bad: #e05555;
    --good: #4ade80;
}

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

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.data-loading {
    text-align: center;
    padding: 2rem;
    color: var(--accent);
    font-size: 0.9rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header p {
    color: var(--muted);
    font-size: 1rem;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.nav-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.nav-btn.groep5 {
    background: rgba(224, 85, 85, 0.1);
    border-color: var(--bad);
    color: var(--bad);
}

.nav-btn.groep5.active {
    background: var(--bad);
    color: white;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter {
    flex: 1;
    min-width: 180px;
}

.filter label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.filter select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
}

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

/* Story section - THE MAIN HEADLINE */
.story {
    background: linear-gradient(135deg, var(--card) 0%, rgba(212, 168, 83, 0.08) 100%);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.story-context {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.story-headline {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bad);
    margin-bottom: 1rem;
}

.story-text {
    font-size: 1.1rem;
    color: var(--text);
    max-width: 600px;
    margin: 0 auto;
}

.story-text strong {
    color: var(--accent);
}

.story-text .highlight {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--bad);
}

/* Regio Focus */
.regio-focus {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.regio-focus h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.comparison-item {
    text-align: center;
}

.comp-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.comp-value {
    font-size: 2rem;
    font-weight: 700;
}

.comp-value.worse { color: var(--bad); }
.comp-value.better { color: var(--good); }

.comp-context {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* Ranking */
.ranking-section {
    margin-bottom: 2rem;
}

.ranking-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.section-intro {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.ranking {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card);
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.ranking-item.below-avg {
    border-left-color: var(--bad);
    background: rgba(224, 85, 85, 0.08);
}

.rank {
    font-weight: 600;
    color: var(--muted);
    width: 30px;
}

.name {
    flex: 1;
    font-weight: 500;
}

.bar-container {
    width: 150px;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.bar {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ranking-item.below-avg .bar {
    background: var(--bad);
}

.pct {
    font-weight: 600;
    width: 50px;
    text-align: right;
}

.count {
    font-size: 0.85rem;
    color: var(--muted);
    width: 120px;
    text-align: right;
}

/* Trend */
.trend-section {
    margin-bottom: 2rem;
}

.trend-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.chart-container {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    height: 250px;
}

.trend-insight {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--card);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    font-size: 0.95rem;
    color: var(--text);
}

/* Source */
.source {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}

/* Verhaalzoeker Button */
.verhaalzoeker-btn {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.verhaalzoeker-btn:hover {
    background: #e5b964;
    transform: translateY(-1px);
}

/* Verhaalzoeker Section */
.verhaalzoeker {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--accent);
}

.verhaalzoeker h2 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Random Idee Section */
.random-section {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.random-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.random-btn:hover:not(:disabled) {
    background: #e5b964;
    transform: scale(1.02);
}

.random-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.random-idee {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    text-align: left;
}

.random-idee h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.idee-wat {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.idee-hoek {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.idee-cijfers {
    font-size: 0.85rem;
    color: var(--muted);
    display: inline-block;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Ideeën Lijst */
.ideeën-lijst {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.idee-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.idee-card h4 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.idee-card p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.idee-card .idee-hoek {
    font-size: 0.85rem;
    color: var(--accent);
}

.idee-card .idee-cijfers {
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   GROEP 5: RECHTVAARDIGHEID SECTIE
   ═══════════════════════════════════════════════════════════════ */

.groep5-section {
    padding: 1rem 0;
}

.groep5-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.groep5-intro h2 {
    color: var(--bad);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.groep5-vraag {
    color: var(--text);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Sepot Headline */
.sepot-headline {
    background: linear-gradient(135deg, var(--card) 0%, rgba(224, 85, 85, 0.1) 100%);
    border: 1px solid var(--bad);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.sepot-big-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--bad);
    line-height: 1;
}

.sepot-label {
    font-size: 1.1rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.sepot-uitleg {
    font-size: 1rem;
    color: var(--text);
    margin-top: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Flow Visualisation */
.flow-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.flow-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.flow-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    min-width: 120px;
}

.flow-item.bad {
    border: 2px solid var(--bad);
    background: rgba(224, 85, 85, 0.1);
}

.flow-item.good {
    border: 2px solid var(--good);
    background: rgba(74, 222, 128, 0.1);
}

.flow-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.flow-item.bad .flow-number {
    color: var(--bad);
}

.flow-item.good .flow-number {
    color: var(--good);
}

.flow-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--muted);
}

.flow-split {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Sepot Bars */
.sepot-types {
    margin-bottom: 2rem;
}

.sepot-types h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.sepot-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sepot-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--card);
    border-radius: 8px;
}

.sepot-type-name {
    width: 200px;
    font-size: 0.9rem;
    color: var(--text);
}

.sepot-bar-container {
    flex: 1;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.sepot-bar {
    height: 100%;
    background: var(--bad);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.sepot-pct {
    width: 50px;
    font-weight: 600;
    color: var(--bad);
    text-align: right;
}

.sepot-count {
    width: 100px;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: right;
}

/* Groep 5 Verhalen */
.groep5-verhalen {
    margin-bottom: 2rem;
}

.groep5-verhalen h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Uitleg Box */
.groep5-uitleg {
    background: var(--card);
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid var(--bad);
    margin-bottom: 2rem;
}

.groep5-uitleg h4 {
    font-size: 0.9rem;
    color: var(--bad);
    margin-bottom: 0.5rem;
}

.groep5-uitleg p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* Groep 5 Filters */
.g5-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card);
    border-radius: 8px;
}

.g5-filters .filter {
    min-width: 150px;
}

/* Sepot Types Uitleg */
.sepot-types-uitleg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.sepot-type-box {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.sepot-type-box.highlight {
    border-color: var(--bad);
    background: rgba(224, 85, 85, 0.05);
}

.sepot-type-box h5 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sepot-type-box .badge {
    font-size: 0.7rem;
    background: var(--bad);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.sepot-type-box p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.sepot-type-box ul {
    margin: 0;
    padding-left: 1.2rem;
}

.sepot-type-box li {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.sepot-bron {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.sepot-bron a {
    color: var(--accent);
    font-size: 0.9rem;
    text-decoration: none;
}

.sepot-bron a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    .filter {
        min-width: 100%;
    }

    .comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .story-headline {
        font-size: 1.75rem;
    }

    .ranking-item {
        flex-wrap: wrap;
    }

    .bar-container {
        width: 80px;
    }

    .count {
        width: 100%;
        text-align: left;
        margin-top: 0.25rem;
    }

    .sepot-types-uitleg {
        grid-template-columns: 1fr;
    }
}
