/* ==========================================================
   style.css - Gemeinsame Styles für alle SFG-Ohlstadt-Seiten
   ========================================================== */

/* --- Design Tokens --- */
:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --radius: 12px;
    --green: #16a34a;
    --yellow: #ca8a04;
    --orange: #ea580c;
    --red: #dc2626;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
}

/* --- Navigation --- */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--border);
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
}
.nav-logo img {
    height: 40px;
    width: auto;
}
.nav-logo span {
    white-space: nowrap;
}
.nav-links {
    display: flex;
    gap: 4px;
}
.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.nav-links a:hover {
    color: var(--text);
    background: var(--bg);
}
.nav-links a.active {
    color: var(--accent);
    background: var(--accent-light);
}

/* --- Layout --- */
.container {
    max-width: 1080px;
    margin: 24px auto;
    padding: 0 20px;
}
.page-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}
.subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 20px;
    font-size: 0.88rem;
}

/* --- Cards --- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }

/* --- Day Tabs --- */
.day-tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; flex-wrap: wrap; }
.day-tab {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.15s;
    min-width: 120px;
    text-align: center;
    box-shadow: var(--shadow);
}
.day-tab:hover { border-color: var(--accent); color: var(--accent); }
.day-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.day-tab .tab-score { display: block; font-size: 1.1rem; margin-top: 4px; color: var(--score-color, var(--accent)); }
.day-tab.active .tab-score { color: white; }
.day-content { display: none; }
.day-content.active { display: block; }

/* --- KI-Briefing Block --- */
.ai-briefing {
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.15), 0 8px 10px -6px rgba(14, 165, 233, 0.1);
    position: relative;
    overflow: hidden;
}
.ai-briefing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8, #818cf8);
}
.ai-briefing-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px -2px rgba(14, 165, 233, 0.3);
}
.ai-briefing p { margin: 0 0 12px; color: #0f172a; font-size: 0.92rem; line-height: 1.65; }
.ai-briefing p:last-child { margin-bottom: 0; }

/* --- Section Accordion (Wetter) --- */
.section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.section-header {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s;
    user-select: none;
}
.section-header:hover { background: var(--bg); }
.section-header .icon {
    font-size: 0.75rem;
    font-weight: 700;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    flex-shrink: 0;
}
.section-header .arrow { margin-left: auto; color: var(--muted); transition: transform 0.2s; font-size: 0.8rem; }
.section-header.open .arrow { transform: rotate(90deg); }
.section-body { display: none; padding: 0 18px 18px; }
.section-body.open { display: block; }

/* --- Metric Cards --- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; }
.m-card { background: var(--bg); padding: 14px; border-radius: 10px; border: 1px solid var(--border); }
.m-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.m-value { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.m-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* --- Score Pill --- */
.score-pill { display: inline-block; padding: 3px 12px; border-radius: 20px; font-weight: 700; font-size: 0.8rem; color: white; }

/* --- Wind Table --- */
.wind-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.wind-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; padding: 10px 12px; border-bottom: 2px solid var(--border); letter-spacing: 0.3px; }
.wind-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.wind-table tr:last-child td { border-bottom: none; }
.wind-table tr:hover td { background: var(--bg); }
.wind-table .level-name { font-weight: 600; }

/* --- Phase Bars --- */
.phase-bar { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.phase-bar:last-child { border-bottom: none; }
.phase-time { min-width: 50px; color: var(--muted); font-family: 'SF Mono', Consolas, monospace; font-size: 0.82rem; }
.phase-dots { min-width: 70px; letter-spacing: 2px; }
.dot-on { color: var(--green); }
.dot-off { color: #d4d4d4; }
.phase-detail { flex: 1; color: var(--muted); font-size: 0.82rem; }

/* --- Alerts --- */
.alert-warn { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 0.88rem; color: #991b1b; }
.alert-bonus { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 0.88rem; color: #166534; }

/* --- Recommendation Badges --- */
.rec-go { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.rec-maybe { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.rec-no { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* --- Austrocontrol Block --- */
.ac-block {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.ac-block h3 { font-size: 0.95rem; color: var(--accent); margin-bottom: 12px; }
.ac-text { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.ac-label { color: var(--text); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px; margin-bottom: 4px; }

/* --- Footer --- */
.footer {
    text-align: center;
    margin-top: 20px;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--muted);
    font-size: 0.78rem;
}
.detail-links { margin-top: 10px; }
.detail-links a { color: var(--accent); text-decoration: none; margin: 0 8px; font-size: 0.82rem; }
.detail-links a:hover { text-decoration: underline; }

/* --- Utility --- */
.no-data { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.briefing-meta { text-align: center; color: var(--muted); font-size: 0.82rem; margin-bottom: 20px; }
.loading { display: none; color: var(--accent); text-align: center; padding: 20px; }

/* --- Responsive --- */
@media (max-width: 640px) {
    .main-nav {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    .nav-links a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .metrics { grid-template-columns: 1fr; }
    .phase-detail { display: none; }
    body { font-size: 0.95rem; }
    .day-tabs { gap: 6px; }
    .day-tab { flex: 1; min-width: 0; }
    .page-title { font-size: 1.3rem; }
    .ai-briefing { padding: 20px; }
    .ai-briefing p { font-size: 0.88rem; }
    .section-header { padding: 12px 14px; font-size: 0.85rem; }
    .section-body { padding: 0 14px 14px; }
    .wind-table { font-size: 0.8rem; }
    .wind-table th, .wind-table td { padding: 8px 6px; }
}
