:root {
    --bg-color: #f2f4f8;
    --card-bg: #ffffff;
    --text-main: #1c1c1e;
    --text-muted: #8e8e93;
    --primary: #007aff;
    --danger: #ff3b30;
    --success: #34c759;
    --border-radius: 12px;
    --spacing: 16px;
    --input-bg: #f2f4f8;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000000;
        --card-bg: #1c1c1e;
        --text-main: #ffffff;
        --text-muted: #98989d;
        --input-bg: #2c2c2e;
        --primary: #0a84ff;
    }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 90px; /* Platz für Bottom Bar */
}

h1, h2, h3, h4 { margin: 0 0 10px 0; font-weight: 600; }

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing);
}

/* UI Components */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing);
    margin-bottom: var(--spacing);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

input, select, textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: none;
    background: var(--input-bg);
    border-radius: 8px;
    font-size: 16px;
    color: var(--text-main);
    appearance: none;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: opacity 0.2s;
}
button:active { opacity: 0.8; }

.btn-secondary { background-color: var(--text-muted); }
.btn-cancel {
    display: block; text-align: center; margin-top: 10px;
    color: var(--text-muted); text-decoration: none; padding: 10px;
}
.btn-map {
    display: inline-block; width: auto;
    background: #e1f0ff; color: var(--primary);
    padding: 8px 12px; border-radius: 6px; font-size: 0.9rem;
    text-decoration: none; margin-top: 10px;
}
@media (prefers-color-scheme: dark) { .btn-map { background: #0a2a4a; } }

/* Tags */
.type-tag {
    font-size: 0.75rem; text-transform: uppercase;
    padding: 4px 8px; border-radius: 4px; font-weight: bold;
    color: #fff; background: var(--text-muted);
}
.tag-person { background-color: #007aff; }
.tag-event { background-color: #ff9500; }
.tag-object { background-color: #af52de; }
.tag-group { background-color: #34c759; }

/* Dashboard Highlight */
.highlight-card { border-left: 4px solid var(--primary); }
.event-row {
    display: flex; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.event-row:last-child { border: none; }
.event-date { font-weight: bold; color: var(--text-muted); width: 60px;}
.event-age { color: var(--text-muted); font-size: 0.9rem; }
.event-name a { text-decoration: none; color: var(--text-main); }

/* Detail Page */
.card-header { display: flex; justify-content: space-between; align-items: center; }
.icon-btn { font-size: 1.2rem; text-decoration: none; margin-left: 10px; border:none; background:none; cursor:pointer;}
.icon-btn.delete { color: var(--danger); }
.details-text { line-height: 1.5; margin-top: 10px; word-wrap: break-word; }
.details-text a { color: var(--primary); }
.meta-date { color: var(--text-muted); margin-bottom: 10px; }

/* Relation List */
.rel-card { padding: 12px; display: flex; justify-content: space-between; align-items: center; }
.rel-label { font-size: 0.85rem; color: var(--text-muted); display: block; }
.rel-link { font-weight: bold; text-decoration: none; color: var(--text-main); font-size: 1.1rem; }
.icon-btn-small { background: none; border: none; font-size: 1rem; color: var(--text-muted); cursor: pointer; }

/* Path Visual */
.path-node { font-weight: bold; font-size: 1.2rem; text-align: center; padding: 10px; background: var(--input-bg); border-radius: 8px;}
.path-arrow { text-align: center; color: var(--text-muted); margin: 5px 0; }

/* Bottom Navigation */
.nav-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex; justify-content: space-around;
    padding: 10px 0; padding-bottom: max(10px, env(safe-area-inset-bottom));
    backdrop-filter: blur(10px);
    z-index: 100;
}
.nav-item {
    text-decoration: none; color: var(--text-muted);
    font-size: 10px; text-align: center;
    display: flex; flex-direction: column; align-items: center;
    width: 25%;
}
.nav-item .icon { font-size: 24px; margin-bottom: 4px; display: block; }
.nav-item.active { color: var(--primary); }
