/* Weltzeituhr.ch — Stylesheet
   Farben und Abstände sind als CSS-Variablen definiert (siehe :root und [data-theme="light"]).
   Eigene Anpassungen: einfach die Variablenwerte weiter unten ändern. */

:root {
  --bg: #0b1120;
  --bg-elevated: #101a2e;
  --card: #131f36;
  --card-hover: #182746;
  --border: #24314f;
  --text: #e8ecf6;
  --text-muted: #8f9bb8;
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-contrast: #06141f;
  --success: #34d399;
  --danger: #f87171;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 8px;
  --max-width: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-hover: #f0f4fb;
  --border: #e1e6f0;
  --text: #131b2e;
  --text-muted: #5c6579;
  --accent: #0891b2;
  --accent-2: #4f46e5;
  --accent-contrast: #ffffff;
  --shadow: 0 8px 24px rgba(20, 30, 60, 0.08);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
}
.main-nav a:hover { color: var(--text); background: var(--card); }
.main-nav a.active { color: var(--text); background: var(--card); }

.search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.search-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 60;
}
.search-results.open { display: block; }

.search-results a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--card-hover); }
.search-results .r-country { color: var(--text-muted); font-size: 0.82rem; }
.search-results .r-empty { padding: 14px; color: var(--text-muted); font-size: 0.88rem; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.theme-toggle:hover { background: var(--card-hover); }

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 36px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.02rem;
}

/* ---------- Sections ---------- */

section { padding: 28px 0; }
.section-title {
  font-size: 1.3rem;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.section-lead {
  color: var(--text-muted);
  margin: -10px 0 20px;
  max-width: 720px;
}

/* ---------- City cards grid ---------- */

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.city-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.city-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.city-card .cc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.city-card .cc-name { font-weight: 600; font-size: 1.05rem; }
.city-card .cc-offset {
  font-size: 0.75rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.city-card .cc-time {
  font-size: 1.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin: 4px 0;
}
.city-card .cc-date { color: var(--text-muted); font-size: 0.85rem; }
.city-card .cc-country { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }

/* small variant used in "similar cities" */
.city-card.small { padding: 14px; }
.city-card.small .cc-time { font-size: 1.3rem; }

/* ---------- Map ---------- */

.map-box {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 420px;
}
.map-box.map-small { height: 320px; }
.leaflet-container { background: var(--bg-elevated) !important; }

/* ---------- About ---------- */

.about {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about p { color: var(--text-muted); max-width: 760px; }
.about a { color: var(--accent); font-weight: 500; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- City detail page ---------- */

.breadcrumb {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 20px;
}
.breadcrumb a:hover { color: var(--accent); }

.clock-hero {
  text-align: center;
  padding: 30px 0 10px;
}
.clock-hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.clock-hero h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0 0 18px; }
.clock-hero .big-time {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}
.clock-hero .big-date {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 30px 0;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-box .st-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-box .st-value { font-size: 1.15rem; font-weight: 600; }
.stat-box .st-value.on { color: var(--success); }
.stat-box .st-value.off { color: var(--text-muted); }

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.info-table tr { border-bottom: 1px solid var(--border); }
.info-table tr:last-child { border-bottom: none; }
.info-table th, .info-table td {
  text-align: left;
  padding: 13px 18px;
  font-size: 0.92rem;
}
.info-table th { color: var(--text-muted); font-weight: 500; width: 45%; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.faq-item h3 { margin: 0 0 8px; font-size: 1rem; }
.faq-item p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Compare page ---------- */

.compare-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.compare-toolbar .search-wrap { max-width: 420px; flex: 1 1 320px; }

.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  min-width: 720px;
}
.compare-table th, .compare-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  white-space: nowrap;
}
.compare-table thead th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table .ct-city { font-weight: 600; }
.compare-table .ct-country { color: var(--text-muted); font-weight: 400; font-size: 0.82rem; }
.compare-table .ct-time { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.compare-table .ref-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}
.diff-pos { color: var(--success); }
.diff-neg { color: var(--danger); }
.diff-zero { color: var(--text-muted); }

.btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn + .btn { margin-left: 6px; }

.compare-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .main-nav { order: 3; width: 100%; }
  .site-header .container { padding-top: 12px; padding-bottom: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Rechtstexte (Impressum / Datenschutz) ---------- */

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 40px;
}
.legal h2 {
  font-size: 1.15rem;
  margin: 34px 0 10px;
  letter-spacing: -0.01em;
}
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--text-muted); font-size: 0.95rem; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin: 4px 0; }
.legal a { color: var(--accent); }
.legal .placeholder {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
