/* Fliegen ohne Flugleiter – Responsive Web Design */

:root {
    --primary: #1a5276;
    --primary-light: #2e86c1;
    --accent: #e67e22;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dfe6e9;
    --radius: 8px;
}

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

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

/* ── Navigation ──────────────────────────────────────────── */

.navbar {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.nav-brand a { color: white; text-decoration: none; }
.nav-icon { font-size: 1.4rem; }

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-aerodrome {
    margin-left: auto;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icao-badge {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ── Container & Sections ────────────────────────────────── */

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

h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.section {
    margin-bottom: 2rem;
}

/* ── Statistik-Karten ────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
}

a.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}

a.stat-card-link:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ── Source Badges ────────────────────────────────────────── */

.source-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.source-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.source-adsb { background: #ebf5fb; color: #1a5276; }
.source-ogn { background: #eafaf1; color: #1e8449; }
.source-radio { background: #fef9e7; color: #9a7d0a; }
.source-camera { background: #f5eef8; color: #6c3483; }

/* ── Status Badges ───────────────────────────────────────── */

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pilot { background: #d5f5e3; color: #1e8449; }
.status-auto { background: #ebf5fb; color: #2e86c1; }
.status-open { background: #fdebd0; color: #ca6f1e; }

/* ── Tabellen ────────────────────────────────────────────── */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.flugbuch-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.flugbuch-table thead {
    background: var(--primary);
    color: white;
}

.flugbuch-table th {
    padding: 0.75rem 0.6rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.flugbuch-table td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.flugbuch-table tbody tr:hover {
    background: #f8f9fa;
}

.row-confirmed { border-left: 3px solid var(--success); }
.row-auto { border-left: 3px solid var(--primary-light); }
.row-unconfirmed { border-left: 3px solid var(--warning); }

.callsign {
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", monospace;
}

.empty-row {
    text-align: center;
    color: var(--text-light);
    padding: 2rem !important;
}

.entry-count {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ── Datum-Filter ────────────────────────────────────────── */

.date-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.date-filter label {
    font-weight: 600;
    font-size: 0.9rem;
}

.date-filter input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ── Buttons ─────────────────────────────────────────────── */

button, .btn-primary, .btn-secondary, .btn-export {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.btn-primary, button[type="submit"] {
    background: var(--primary);
    color: white;
}

.btn-primary:hover, button[type="submit"]:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #c8d6e5;
}

.btn-export {
    background: var(--success);
    color: white;
}

.btn-export:hover {
    background: #229954;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* ── Pilot-Karten ────────────────────────────────────────── */

.pilot-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.pilot-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.pilot-card-header {
    background: var(--primary);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.callsign-large {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", monospace;
}

.aircraft-type {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.pilot-card-body {
    padding: 1.25rem;
}

.flight-info { margin-bottom: 1rem; }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
}

.info-value { font-weight: 500; }

.pilot-card-sources {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pilot-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ── Formular ────────────────────────────────────────────── */

.edit-form {
    max-width: 700px;
}

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

legend {
    font-weight: 700;
    color: var(--primary);
    padding: 0 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(46,134,193,0.15);
}

.form-group input:disabled {
    background: #f0f0f0;
    color: var(--text-light);
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

/* ── Empty State ─────────────────────────────────────────── */

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

.empty-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
}

/* ── Footer ──────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.footer-credit {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
    margin-top: 0.5rem;
}

.footer-credit a {
    display: inline-flex;
    align-items: flex-end;
    gap: 4px;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-credit a:hover {
    color: var(--text);
}

.footer-logo {
    height: 28px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-aerodrome {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .pilot-cards {
        grid-template-columns: 1fr;
    }

    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }

    h1 { font-size: 1.4rem; }
}

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

    .container {
        padding: 1rem;
    }
}
