/* ===== BASIS ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

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

/* ===== HEADER ===== */
.main-header {
    background: #1e293b;
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid #334155;
}

.main-header h1 {
    margin: 0.5rem 0;
    font-size: 1.8rem;
}

.main-header h1 u {
    text-decoration: none;
    border-bottom: 2px solid #64748b;
}

.main-header img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.main-header a {
    color: #60a5fa;
    text-decoration: none;
}

.main-header a:hover {
    text-decoration: underline;
}

/* ===== DISCLAIMER & INFO BOXEN ===== */
.disclaimer-box {
    background: #2d1b1b;
    border: 1px solid #7f1d1d;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #fca5a5;
}

.disclaimer-box strong { color: #f87171; }
.disclaimer-box p { margin: 0.5rem 0; line-height: 1.5; }

.info-box {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.info-box p { margin: 0.5rem 0; line-height: 1.6; }
.info-box strong { color: #e2e8f0; }
.info-box code {
    background: #7b923b;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
}

/* ===== PROMPT BOX (Spezialfall) ===== */
.prompt-box {
    /* Wir kopieren das Aussehen der info-box */
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #94a3b8;
    
    /* HIER ist der Unterschied: Text explizit linksbündig */
    text-align: left; 
}

.prompt-box p { 
    margin: 0.5rem 0; 
    line-height: 1.6; 
}
.prompt-box strong { 
    color: #e2e8f0; 
}
.prompt-box code {
    background: #7b923b;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
}


/* ===== NAVIGATION ===== */
.top-nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.action-btn, .admin-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    display: inline-block;
}

.action-btn:hover, .admin-btn:hover { background: #2563eb; }
.action-btn:disabled { opacity: 0.6; cursor: wait; }

.admin-btn { background: #64748b; }
.admin-btn:hover { background: #475569; }

/* ===== REGIONEN ===== */
.region-section { margin: 2rem 0; }
.region-title {
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #334155;
    color: #f1f5f9;
}

/* ===== TOGGLE-BUTTONS ===== */
.toggle-controls {
    margin: 0.5rem 0 1rem 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toggle-btn {
    background: #334155;
    color: #e2e8f0;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-btn:hover { background: #475569; }

/* ===== DETAILS/SUMMARY ===== */
details.source-block {
    background: #1e293b;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #334155;
    overflow: hidden;
}

summary.source-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    background: #0f172a;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}
summary.source-header::-webkit-details-marker { display: none; }
summary.source-header::after {
    content: '▶';
    font-size: 0.8em;
    transition: transform 0.2s;
    color: #94a3b8;
    margin-left: auto;
}
details.source-block[open] summary.source-header::after { transform: rotate(90deg); }
summary.source-header:hover { background: #1e293b; }

.article-count {
    font-weight: normal;
    color: #64748b;
    font-size: 0.95em;
}

/* ===== BIAS-VISUALISIERUNG ===== */
.bias-viz { display: inline-flex; align-items: center; gap: 0.5rem; }
.bias-scale {
    position: relative;
    width: 100px;
    height: 4px;
    background: #475569;
    border-radius: 2px;
    display: inline-block;
}
.bias-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 8px;
    background: #64748b;
    transform: translate(-50%, -50%);
}
.bias-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: all 0.3s ease;
}
.bias-arrow::before {
    content: '▸';
    position: absolute;
    color: #60a5fa;
    font-size: 14px;
    line-height: 1;
}
.bias-score-text {
    font-family: monospace;
    color: #94a3b8;
    font-size: 0.85rem;
    min-width: 50px;
}

/* Kompakt-Version für Cards */
.bias-viz-compact { display: inline-flex; align-items: center; gap: 0.3rem; }
.bias-scale-compact {
    position: relative;
    width: 60px;
    height: 3px;
    background: #475569;
    border-radius: 2px;
    display: inline-block;
}
.bias-center-compact {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1px;
    height: 6px;
    background: #64748b;
    transform: translate(-50%, -50%);
}
.bias-arrow-compact {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}
.bias-arrow-compact::before {
    content: '▸';
    position: absolute;
    color: #60a5fa;
    font-size: 11px;
    line-height: 1;
}

/* ===== NEWS GRID ===== */
.news-grid {
    padding: 0 1rem 1rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

/* ===== NEWS CARD ===== */
.news-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.news-card:hover { border-color: #475569; }

.card-content { padding: 0.75rem; }
.card-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    line-height: 1.4;
}
.card-content h4 a {
    color: #e2e8f0;
    text-decoration: none;
}
.card-content h4 a:hover { color: #60a5fa; }
.card-content p {
    margin: 0 0 0.5rem 0;
    color: #94a3b8;
    font-size: 0.9rem;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
}

/* ===== KURIERTE ANSICHT ===== */
.curated-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.curated-card h3 {
    margin: 0 0 1rem 0;
    color: #60a5fa;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
}
.curated-card .meta {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-style: italic;
}
.curated-card .summary {
    line-height: 1.7;
    color: #e2e8f0;
    white-space: pre-wrap;
}
.curated-card .summary strong { color: #fbbf24; }
.curated-card .summary em { color: #94a3b8; }

.placeholder-note {
    background: #0f172a;
    border-left: 4px solid #60a5fa;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    color: #94a3b8;
}

.error-note {
    color: #f87171;
    display: block;
    padding: 0.75rem;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 4px;
    margin: 0.5rem 0;
}
.error-note small { opacity: 0.8; }

.tenor-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}
.tenor-neutral { background: #475569; color: #e2e8f0; }
.tenor-optimistic { background: #22c55e; color: #052e16; }
.tenor-concerned { background: #f97316; color: #431407; }

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #94a3b8;
    text-decoration: none;
}
.back-link:hover { color: #fff; text-decoration: underline; }

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 1.5rem;
    color: #64748b;
    border-top: 1px solid #334155;
    margin-top: 2rem;
}
footer a { color: #94a3b8; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    summary.source-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    summary.source-header::after {
        margin-left: 0;
        align-self: flex-end;
    }
    .news-grid { grid-template-columns: 1fr; }
    .top-nav { flex-direction: column; align-items: center; }
}
