/* Hundebad-Trave — mobile-first, Wasser-Look */
:root {
  --bg: #0e1b26;
  --bg-card: #14242f;
  --bg-card-2: #182c39;
  --text: #e8f1f5;
  --text-dim: #9fb4c0;
  --line: #24404f;
  --accent: #35b6e0;
  --good: #38c172;
  --good-bg: rgba(56, 193, 114, 0.12);
  --bad: #f2a23b;
  --bad-bg: rgba(242, 162, 59, 0.12);
  --info: #5aa9e6;
  --danger: #e35d6a;
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(53, 182, 224, 0.16), transparent 60%),
    radial-gradient(900px 400px at 0% 110%, rgba(53, 182, 224, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

#app { max-width: 880px; margin: 0 auto; padding: 16px 14px 40px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 6px 2px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 2.2rem; }
.brand h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0.2px; }
.brand .sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-dim); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.updated { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.card h2 { margin: 0 0 10px; font-size: 1.02rem; font-weight: 650; }
.small { font-size: 0.8rem; }
.muted { color: var(--text-dim); }
.hint { font-size: 0.8rem; color: var(--text-dim); }

/* ---------- Banner ---------- */
.banner {
  background: rgba(227, 93, 106, 0.14);
  border: 1px solid rgba(227, 93, 106, 0.5);
  color: #ffd9dd;
  border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 14px; font-size: 0.9rem;
}
.hidden { display: none !important; }

/* ---------- Spot bar ---------- */
.spot-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spot-label { font-size: 0.85rem; color: var(--text-dim); }
.spot-bar select {
  flex: 1 1 180px; max-width: 320px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; font-size: 0.95rem;
}
.spot-bar .hint { flex-basis: 100%; }

/* ---------- Status card ---------- */
.status-card { display: flex; gap: 14px; align-items: flex-start; }
.status-icon { font-size: 2.6rem; line-height: 1; margin-top: 2px; }
.status-body { flex: 1; }
.status-title { font-size: 1.25rem; font-weight: 700; }
.status-detail { margin-top: 4px; color: var(--text); font-size: 0.95rem; }
.status-meta { margin-top: 8px; font-size: 0.8rem; color: var(--text-dim); display: flex; gap: 10px; flex-wrap: wrap; }
.status-meta .pill {
  background: rgba(90, 169, 230, 0.12); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.status-card.ok { border-color: rgba(56, 193, 114, 0.55); background: linear-gradient(180deg, rgba(56,193,114,0.10), var(--bg-card)); }
.status-card.no { border-color: rgba(242, 162, 59, 0.55); background: linear-gradient(180deg, rgba(242,162,59,0.10), var(--bg-card)); }

/* ---------- Windows ---------- */
.windows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.windows li {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 0.92rem;
}
.windows .win-when { font-weight: 650; }
.windows .win-dur { color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; }
.windows .now-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.4px;
  background: var(--good); color: #08281a; padding: 1px 8px; border-radius: 999px; margin-right: 8px;
}
#windowsNote { margin: 10px 0 0; }

/* ---------- Chart ---------- */
.chart { width: 100%; overflow: hidden; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 0.8rem; color: var(--text-dim); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.legend .swatch.dashed { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); height: 2px; }
.official { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }

/* ---------- Badewoche ---------- */
.swim-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.swim-chip {
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  padding: 9px 4px; text-align: center; min-width: 0;
}
.swim-chip .chip-day { font-size: 0.74rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swim-chip .chip-val { font-size: 0.95rem; font-weight: 700; margin-top: 3px; white-space: nowrap; }
.swim-chip.ok { border-color: rgba(56, 193, 114, 0.6); background: rgba(56, 193, 114, 0.10); }
.swim-chip.likely { border-color: rgba(242, 162, 59, 0.6); background: rgba(242, 162, 59, 0.10); }
.swim-chip.no { opacity: 0.7; }
.swim-chip.unknown { border-style: dashed; opacity: 0.55; }

/* ---------- Settings ---------- */
.spot-row {
  display: grid; grid-template-columns: 1fr 110px auto 110px auto;
  gap: 8px; align-items: center; margin-bottom: 8px;
}
.spot-row input[type="text"] {
  grid-column: 1 / 2; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 0.95rem; width: 100%;
}
.spot-row input[type="number"],
.spot-row input[type="time"] {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 8px; font-size: 0.95rem; width: 100%;
  color-scheme: dark;
}
.spot-row .unit { font-size: 0.75rem; color: var(--text-dim); }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.save-msg { font-size: 0.85rem; color: var(--good); }

/* ---------- Buttons ---------- */
.btn {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; font-size: 0.92rem; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: #1c3341; border-color: #33566a; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06222e; font-weight: 700; }
.btn.primary:hover { background: #4cc4ea; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-icon {
  background: transparent; border: none; font-size: 1.05rem; cursor: pointer; color: var(--text-dim);
  padding: 4px 6px; border-radius: 8px;
}
.btn-icon:hover { background: rgba(227, 93, 106, 0.15); color: var(--danger); }

/* ---------- Footer ---------- */
.footer { margin-top: 8px; padding: 14px 4px 0; border-top: 1px solid var(--line); color: var(--text-dim); font-size: 0.88rem; }
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer p { margin: 4px 0; }

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: #0b1620; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; font-size: 0.82rem; color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); max-width: 240px;
}
.tooltip .tt-title { font-weight: 650; margin-bottom: 2px; }
.tooltip .tt-val { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  #app { padding: 10px 10px 30px; }
  .brand h1 { font-size: 1.15rem; }
  .status-card { flex-direction: column; gap: 8px; }
  .status-icon { font-size: 2rem; }
  .spot-row { grid-template-columns: 1fr 1fr auto; }
  .spot-row input[type="text"] { grid-column: 1 / -1; }
  .spot-row .unit { display: none; }
  .swim-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
