/* ════════════════════════════════════════════════
   fly.steudle.de — einheitliches Stylesheet
   Dunkles Cockpit-Theme (Standard) + Light-Mode
   Umschaltung über <html data-theme="light|dark">
   ════════════════════════════════════════════════ */

/* ── Dark theme (default) ── */
:root {
	--bg:        #07090d;
	--surface:   #141926;
	--surface2:  #1f2739;
	--border:    #45507a;
	--amber:     #ffb02e;
	--amber-dim: #6b4a10;
	--green:     #4cd07d;
	--blue:      #6cb2ff;
	--text:      #f2f5fc;
	--text-dim:  #9aa6c4;
	--radius:    12px;
	--radius-sm: 8px;
	--font:      'Consolas', 'Courier New', monospace;
}

/* ── Light theme ── */
[data-theme="light"] {
	--bg:        #eceff5;
	--surface:   #ffffff;
	--surface2:  #dde3ee;
	--border:    #7c8aa5;
	--amber:     #8a4a00;
	--amber-dim: #ffe3b0;
	--green:     #0d7a40;
	--blue:      #0d5cc4;
	--text:      #0a1020;
	--text-dim:  #3d4a66;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	padding: 16px;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 19px;
	line-height: 1.5;
}

.wrap {
	max-width: 560px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* ── Header mit Datum + Theme-Umschalter ── */
.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.date-line {
	font-size: 24px;
	font-weight: bold;
}
.theme-btn {
	background: var(--surface);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font);
	font-size: 21px;
	padding: 6px 14px;
	cursor: pointer;
}
.theme-btn:active { background: var(--surface2); }

/* ── Cards ── */
.card {
	background: var(--surface);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 16px;
}
.card-label {
	font-size: 14px;
	font-weight: bold;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--text-dim);
	margin-bottom: 8px;
}

/* ── Uhr ── */
.clock-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	text-align: center;
}
.clock-cell .clock-time {
	font-size: 44px;
	font-weight: bold;
	color: var(--amber);
	line-height: 1.15;
}
.clock-cell .clock-zone {
	font-size: 15px;
	font-weight: bold;
	letter-spacing: 3px;
	color: var(--text-dim);
}

/* ── Sonnenzeiten ── */
.sun-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 21px;
}
.sun-row .sun-time  { color: var(--amber); font-weight: bold; }
.sun-row .sun-label { color: var(--text-dim); }

/* ── Link-Listen ── */
.linklist { display: flex; flex-direction: column; }
.linklist a {
	display: block;
	padding: 12px 14px;
	margin: 4px 0;
	background: var(--surface2);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-weight: bold;
	text-decoration: none;
}
.linklist a:active,
.linklist a:hover { border-color: var(--amber); }
.linklist a.locked::after {
	content: "🔒";
	float: right;
	opacity: 0.7;
}

/* ── Webcam ── */
.webcam img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
	border: 2px solid var(--border);
}

/* ── Buttons ── */
.btn-refresh {
	display: block;
	width: 100%;
	padding: 14px;
	background: var(--amber-dim);
	border: 2px solid var(--amber);
	border-radius: var(--radius);
	color: var(--text);
	font-family: var(--font);
	font-size: 20px;
	font-weight: bold;
	cursor: pointer;
}
.btn-refresh:active { background: var(--amber); color: var(--bg); }

.footer {
	text-align: center;
	font-size: 15px;
	color: var(--text-dim);
	padding-bottom: 8px;
}

/* ════════════════════════════════════════════════
   Generische Elemente für die übrigen Seiten
   (hoehen, icao, startstrecke, zeitrechnung, …)
   ════════════════════════════════════════════════ */

h1, h2 {
	color: var(--amber);
	line-height: 1.2;
	margin: 0 0 12px 0;
}
h1 { font-size: 26px; }
h2 { font-size: 22px; }

a { color: var(--blue); }

input, select, textarea {
	background: var(--surface2);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font);
	font-size: 19px;
	padding: 10px 12px;
}
input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--amber);
}

button, .button {
	background: var(--surface2);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font);
	font-size: 19px;
	font-weight: bold;
	padding: 10px 16px;
	cursor: pointer;
}
button:active, .button:active { border-color: var(--amber); }

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 19px;
}
th, td {
	padding: 8px 10px;
	text-align: left;
	border-bottom: 1px solid var(--border);
}
th {
	color: var(--text-dim);
	font-size: 15px;
	letter-spacing: 1px;
	text-transform: uppercase;
}

/* ── Seitentitel (Unterseiten) ── */
.page-title {
	font-size: 24px;
	font-weight: bold;
}

/* ── Formulare ── */
.form-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 0;
}
.form-row label {
	flex: 1;
	color: var(--text-dim);
	font-weight: bold;
}
.form-row input[type="text"],
.form-row input[type="number"] {
	width: 110px;
	text-align: right;
}
.form-unit {
	width: 52px;
	color: var(--text-dim);
}

.checkbox-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 7px 0;
}
.checkbox-row input[type="checkbox"] {
	width: 26px;
	height: 26px;
	flex-shrink: 0;
	accent-color: var(--amber);
}

.search-row {
	display: flex;
	gap: 8px;
}
.search-row input { flex: 1; min-width: 0; }

/* Primär-Button (volle Breite), gleiche Optik wie .btn-refresh */
.btn-primary {
	display: block;
	width: 100%;
	padding: 14px;
	background: var(--amber-dim);
	border: 2px solid var(--amber);
	border-radius: var(--radius);
	color: var(--text);
	font-family: var(--font);
	font-size: 20px;
	font-weight: bold;
	cursor: pointer;
}
.btn-primary:active { background: var(--amber); color: var(--bg); }
form .btn-primary { margin-top: 14px; }

/* ── Berechnungszeilen (hoehen, startstrecke) ── */
.calc-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	padding: 4px 0;
}
.calc-label { color: var(--text-dim); }
.calc-value { font-weight: bold; white-space: nowrap; text-align: right; }
.calc-row.total {
	border-top: 2px solid var(--border);
	margin-top: 8px;
	padding-top: 10px;
}
.calc-row.total .calc-label { color: var(--text); font-weight: bold; }
.calc-row.total .calc-value { color: var(--amber); font-size: 23px; }

/* ── Suchergebnisse (icao) ── */
.result-row {
	display: flex;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-row .code {
	flex-shrink: 0;
	width: 80px;
}
.result-row .code a {
	color: var(--amber);
	font-weight: bold;
	text-decoration: none;
}

/* ── Tracker: Flugzeuge mit Link-Buttons ── */
.plane { padding: 10px 0; }
.plane + .plane { border-top: 1px solid var(--border); }
.plane-name {
	font-weight: bold;
	margin-bottom: 8px;
}
.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.btn-row a {
	flex: 1;
	min-width: 70px;
	text-align: center;
	padding: 10px 6px;
	background: var(--surface2);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--blue);
	font-weight: bold;
	text-decoration: none;
}
.btn-row a:active, .btn-row a:hover { border-color: var(--amber); }

/* ── Karten mit iframes (meteoblue, windy) ── */
.iframe-card iframe {
	display: block;
	width: 100%;
	border: 0;
	border-radius: var(--radius-sm);
	background: #fff;
}

/* ── QNH-Anzeige (qnh.php und Startseite) ── */
.qnh-row {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
}
.qnh-row + .qnh-row { border-top: 1px solid var(--border); }
.qnh-icao {
	font-size: 22px;
	font-weight: bold;
	color: var(--amber);
}
.qnh-name { color: var(--text-dim); }
.qnh-meta {
	color: var(--text-dim);
	font-size: 17px;
	margin-top: 2px;
}
.qnh-value {
	font-size: 34px;
	font-weight: bold;
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.qnh-value small {
	font-size: 15px;
	font-weight: normal;
	color: var(--text-dim);
}
.qnh-old .qnh-value, .qnh-old .qnh-icao { opacity: 0.55; }

.warnbox {
	background: var(--surface);
	border: 2px solid var(--amber);
	border-radius: var(--radius);
	padding: 12px 16px;
	font-weight: bold;
}

details { margin-top: 6px; }
details summary {
	cursor: pointer;
	color: var(--text-dim);
	font-size: 15px;
}
details p {
	margin: 6px 0 0 0;
	font-size: 15px;
	color: var(--text-dim);
	word-break: break-word;
}

/* Karte als Link (QNH auf der Startseite) */
a.card-link {
	display: block;
	text-decoration: none;
	color: var(--text);
}
a.card-link:active, a.card-link:hover { border-color: var(--amber); }
