/* Globale Resets & Variablen */
:root {
    --bg-color: #050505;
    --panel-bg: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent-red: #d32f2f;
    --accent-green: #388e3c;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none; /* Verhindert ungewolltes Markieren von Text */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Kein Scrollen auf dem Main-Screen */
}

/* --- View Toggling --- */
.hidden {
    display: none !important;
}

/* --- Status Bar --- */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: var(--panel-bg);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.indicator.red { background-color: var(--accent-red); }
.indicator.green { background-color: var(--accent-green); }

/* --- Dashboard / Main Area --- */
.dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

/* Der Event-Logger Button */
.hero-action-btn {
    background-color: var(--accent-red);
    color: white;
    border: none;
    border-radius: 16px;
    flex: 1; /* Nimmt viel Platz ein */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 8px 0 #9a0007; /* Physischer Button-Look */
    cursor: pointer;
}

.hero-action-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 #9a0007;
}

/* Telemetrie-Grid */
.telemetry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.data-box {
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.data-box .label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.data-box .value {
    font-size: 38px;
    font-weight: 800;
}
.data-box .value small {
    font-size: 18px;
    color: var(--text-muted);
}

.log-ticker {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Bottom Nav --- */
.bottom-nav {
    display: flex;
    background-color: var(--panel-bg);
    padding-bottom: env(safe-area-inset-bottom); /* iPhone Notches */
}

.nav-item {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 20px 0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.nav-item.active {
    color: white;
    border-top: 3px solid white;
}

/* --- Tag Modal (Popup) --- */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 20px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.modal-content h2 { margin-bottom: 20px; }

.tag-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.tag-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn {
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-muted);
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* --- Logbuch View --- */
.logbook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#btn-refresh-log {
    background: var(--panel-bg);
    color: var(--text-main);
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-bottom: 30px; /* Platz für den Scrollbereich */
}

/* Design einer Log-Karte */
.log-item {
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 15px;
    border-left: 4px solid var(--accent-red); /* Markanter roter Streifen */
}

.log-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.log-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.log-tag {
    background-color: #333;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.log-meta {
    font-size: 11px;
    color: #666;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #333;
    padding-top: 8px;
}
