/* === Entdecker — Mobile-first Design === */
:root {
    --color-primary: #2d6a4f;
    --color-primary-light: #40916c;
    --color-primary-dark: #1b4332;
    --color-accent: #d4a373;
    --color-accent-light: #e9c89b;
    --color-bg: #fefae0;
    --color-bg-card: #ffffff;
    --color-text: #1a1a1a;
    --color-text-light: #555;
    --color-text-muted: #888;
    --color-border: #ddd;
    --color-danger: #c1121f;
    --color-success: #2d6a4f;
    --color-warning: #e9c46a;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --max-width: 1200px;
}

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

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

/* === Navigation === */
.nav {
    background: var(--color-primary-dark);
    color: white;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

/* Burger menu */
.burger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    flex-direction: column;
    gap: 4px;
}
.burger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.burger-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 768px) {
    .burger-btn { display: flex; }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 0.5rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        padding: 0.6rem 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-inner { flex-wrap: wrap; }
}

/* === Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
}

.page-header p {
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

/* === Cards === */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 0.75rem;
}

/* === Grid === */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

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

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover { background: var(--color-primary-light); }

.btn-secondary {
    background: var(--color-accent);
    color: var(--color-primary-dark);
}
.btn-secondary:hover { background: var(--color-accent-light); }

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Forms === */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox groups — override form-group defaults */
.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-group > span.checkbox-group-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-size: 0.9rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
    margin-bottom: 0.4rem;
}

.checkbox-group label input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
}

/* === Map === */
.map-container {
    width: 100%;
    height: 60vh;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .map-container { height: 70vh; }
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d8f3dc; color: var(--color-primary-dark); }
.badge-warning { background: var(--color-warning, #ffeaa7); color: #6d4c00; }
.badge-danger { background: #ffd7d7; color: var(--color-danger); }
.badge-info { background: var(--color-info-bg, #dbeafe); color: var(--color-info, #1e40af); }

/* === Tabs === */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab {
    padding: 0.6rem 1.2rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    color: var(--color-text-light);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Route Card === */
.route-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

.route-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.route-card-body {
    padding: 1rem;
}

.route-card-body h3 {
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.route-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* === Atom Display === */
.atom {
    border-left: 4px solid var(--color-primary);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background: var(--color-bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow);
}

.atom-anker {
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.atom-verschiebung {
    color: var(--color-text-light);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.atom-oeffnung {
    color: var(--color-primary-dark);
    font-weight: 500;
    font-style: italic;
    line-height: 1.7;
}

/* === Feedback buttons === */
.feedback-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.feedback-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 99px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.feedback-btn:hover {
    border-color: var(--color-primary);
    background: #d8f3dc;
}

.feedback-btn.selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

/* === Audio Recorder === */
.audio-recorder {
    text-align: center;
    padding: 2rem;
}

.record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--color-danger);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.record-btn.recording {
    background: var(--color-danger);
    animation: pulse 1s infinite;
}

.record-btn .dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-danger);
}

.record-btn.recording .dot {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: white;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(193, 18, 31, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(193, 18, 31, 0); }
}

.record-timer {
    margin-top: 0.75rem;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

/* === GPS Status === */
.gps-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: #f0f0f0;
}

.gps-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.gps-dot.active { background: var(--color-success); }
.gps-dot.error { background: var(--color-danger); }

/* === Info Button / Tooltip === */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    font-style: italic;
    border: none;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 0.3rem;
    line-height: 1;
    flex-shrink: 0;
}
.info-btn:hover { background: var(--color-primary-dark); }

.info-flyout {
    display: none;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
    line-height: 1.5;
}
.info-flyout.open { display: block; }

/* === KI Assistant === */
.ki-chat {
    max-width: 600px;
    margin: 0 auto;
}

.ki-message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.ki-message.bot {
    background: #d8f3dc;
    border: 1px solid #b7e4c7;
}

.ki-message.user {
    background: #e3e3e3;
    text-align: right;
}

/* === Table === */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-primary-dark);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background: rgba(45, 106, 79, 0.05);
}

/* === Alerts === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #d8f3dc; color: var(--color-primary-dark); border: 1px solid #b7e4c7; }
.alert-error { background: #ffd7d7; color: var(--color-danger); border: 1px solid #ffb3b3; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* === Utility === */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* === Responsive === */
@media (min-width: 768px) {
    .container { padding: 1.5rem; }
    .page-header h1 { font-size: 2rem; }
    .nav-inner { flex-wrap: nowrap; }
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.85rem;
}
.footer-inner {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.footer-inner a {
    color: var(--color-text-muted, #888);
    text-decoration: none;
}
.footer-inner a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Mobile text/icon toggle */
.show-mobile-only { display: none; }
@media (max-width: 600px) {
    .hide-mobile { display: none !important; }
    .show-mobile-only { display: inline !important; }
}

/* Edit text button (pencil icon for redaktion/admin) */
.edit-text-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-accent-light, #e9c89b);
    color: var(--color-text, #1a1a1a);
    border: 1px solid var(--color-accent, #d4a373);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.edit-text-btn:hover {
    background: var(--color-accent, #d4a373);
}
