/* Baeder-Radar Executive Edition - Dark Theme */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1e2a3a;
    --bg-input: #151d2e;
    --text-primary: #e8edf5;
    --text-secondary: #8892a4;
    --text-muted: #5a6478;
    --accent: #0099cc;
    --accent-light: #33bbee;
    --accent-glow: rgba(0, 153, 204, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --danger-border: rgba(239, 68, 68, 0.4);
    --success: #22c55e;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.4);
}

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

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

a { color: inherit; text-decoration: none; }

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

/* === NAVBAR === */

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.nav-icon { font-size: 1.3rem; }

.nav-title { color: var(--text-primary); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--accent-light); background: var(--accent-glow); }
.nav-admin { font-size: 1.1rem; }

/* === PAGE HEADER === */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 0 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.page-header-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.header-company {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.header-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === ALERTS === */

.alerts-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border-left: 4px solid var(--danger);
    animation: alertPulse 2s ease-in-out;
}

.alert-pool { border-left-color: var(--accent); background: var(--accent-glow); }
.alert-danger { border-left-color: var(--danger); background: var(--danger-bg); }

.alert-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    color: var(--text-secondary);
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.alert-content { flex: 1; min-width: 0; }

.alert-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.4;
}

.alert-title:hover { color: var(--accent-light); }

.alert-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.alert-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.alert-dismiss:hover { color: var(--text-primary); }

@keyframes alertPulse {
    0% { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* === STATS GRID === */

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-light); }

.stat-highlight-blue {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.stat-highlight-red {
    border-color: var(--danger-border);
    background: var(--danger-bg);
}

.stat-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }

.stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* === FILTER BAR === */

.filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 1.25rem;
    scrollbar-width: thin;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.filter-badge {
    background: rgba(255,255,255,0.15);
    padding: 0.1rem 0.45rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
}

.filter-pill.active .filter-badge {
    background: rgba(255,255,255,0.25);
}

/* === ARTICLES FEED === */

.articles-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.article-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.card-pool { border-left-color: var(--accent); }
.card-danger { border-left-color: var(--danger); }

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.article-category {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.cat-unsere_baeder { color: var(--accent-light); }
.cat-sicherheit { color: var(--danger); }
.cat-branche { color: var(--warning); }
.cat-technik { color: #a78bfa; }
.cat-vorschriften { color: #60a5fa; }
.cat-region { color: #34d399; }

.article-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.article-source {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.article-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tag {
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.tag-pool {
    background: var(--accent-glow);
    color: var(--accent-light);
    border-color: rgba(0, 153, 204, 0.3);
}

/* === EMPTY STATE === */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* === LOAD MORE === */

.load-more-wrapper {
    text-align: center;
    padding: 2rem 0;
}

/* === BUTTONS === */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn:hover { border-color: var(--border-light); background: var(--bg-card-hover); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.btn-disabled {
    opacity: 0.3;
    pointer-events: none;
}

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

.btn-danger-text:hover { color: var(--danger); }

/* === BRIEFING === */

.week-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.week-current {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-light);
}

.briefing-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.briefing-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.section-pool { border-left: 4px solid var(--accent); }
.section-danger { border-left: 4px solid var(--danger); }

.section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}

.section-icon { font-size: 1.1rem; }

.section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.section-count {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.section-body { padding: 1rem 1.25rem; }

.section-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.briefing-article {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.briefing-article:last-child { border-bottom: none; }

.briefing-article-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.briefing-article-title:hover { color: var(--accent-light); }

.briefing-article-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.section-more {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-top: 0.5rem;
    font-style: italic;
}

/* === BRIEFING STATS === */

.briefing-stats {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.briefing-stats-header {
    padding: 1rem 1.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

.briefing-stats-body { padding: 1rem 1.25rem; }

.briefing-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.briefing-stat-row span { color: var(--text-secondary); }
.briefing-stat-row strong { color: var(--text-primary); }

/* === MEDIENSPIEGEL === */

.pool-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.pool-stats-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.pool-bars {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pool-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pool-bar-label {
    width: 160px;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.pool-bar-track {
    flex: 1;
    height: 24px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    overflow: hidden;
}

.pool-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.5s ease;
}

.pool-bar-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 130px;
    text-align: right;
    flex-shrink: 0;
}

/* === ADMIN === */

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.feed-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group { flex: 1; min-width: 180px; }
.form-group-wide { flex: 2; }

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238892a4'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.form-select option { background: var(--bg-secondary); color: var(--text-primary); }

.input-with-btn { display: flex; gap: 0.5rem; }
.input-with-btn .form-input { flex: 1; }

.form-actions-inline {
    display: flex;
    align-items: flex-end;
    min-width: auto;
}

.feed-tip {
    margin-top: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
}

.test-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.test-ok { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); }
.test-err { background: var(--danger-bg); border: 1px solid var(--danger-border); }

/* Feeds Table */

.feeds-table { display: flex; flex-direction: column; }

.feed-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.feed-row:last-child { border-bottom: none; }

.feed-inactive { opacity: 0.45; }

.feed-status-icon { font-size: 1rem; flex-shrink: 0; width: 1.5rem; text-align: center; }

.feed-info { flex: 1; min-width: 0; }

.feed-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.feed-cat { color: var(--text-secondary); }
.feed-error { color: var(--danger); }

.feed-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* === LOGIN === */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
}

.login-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    text-align: center;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-card .form-group { margin-bottom: 1.25rem; }

/* === FOOTER === */

.footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === MAIN CONTENT === */

.main-content {
    min-height: calc(100vh - 56px - 80px);
    padding-bottom: 2rem;
}

/* === RESPONSIVE === */

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-right {
        align-items: flex-start;
        flex-direction: row;
        gap: 0.75rem;
    }

    .nav-container { padding: 0 1rem; }
    .container { padding: 0 1rem; }

    .nav-link { padding: 0.5rem 0.65rem; font-size: 0.8rem; }

    .article-card { padding: 1rem; }

    .pool-bar-label { width: 100px; font-size: 0.78rem; }
    .pool-bar-count { width: auto; }

    .form-row { flex-direction: column; }

    .feed-row { flex-wrap: wrap; }
    .feed-info { width: 100%; }

    .filter-bar { flex-wrap: nowrap; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.4rem; }
    .page-title { font-size: 1.2rem; }
    .week-nav { gap: 0.75rem; }
}
