/* Nástěnka – tmavý moderní vzhled, bez závislostí. */

:root {
  --bg: #0b1220;
  --bg-2: #0e1729;
  --card: #131c2e;
  --card-2: #16223a;
  --line: rgba(148, 163, 184, 0.16);
  --text: #e6edf7;
  --muted: #93a3b8;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: 0.01em; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(14px, 3vw, 28px);
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand__mark { font-size: 1.3rem; }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Tlačítka ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #06121f;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover { background: rgba(148, 163, 184, 0.12); filter: none; }

.btn--small { padding: 6px 12px; font-size: 0.88rem; }

.btn--danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--danger);
}
.btn--danger:hover { background: rgba(248, 113, 113, 0.14); filter: none; }

.icon-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1;
}
.icon-btn:hover { background: rgba(148, 163, 184, 0.16); color: var(--text); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---------- Mřížka dlaždic ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  padding: clamp(14px, 3vw, 28px);
  max-width: 1440px;
  margin: 0 auto;
}

@media (min-width: 760px) {
  .tile--wide { grid-column: span 2; }
}

.tile {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tile__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tile__head h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}

.tile__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.tile__empty { color: var(--muted); margin: 4px 0; }
.tile__empty--big { grid-column: 1 / -1; text-align: center; font-size: 1.1rem; padding: 40px 0; }

.tile__error { color: var(--warn); }
.tile__foot { margin-top: auto; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.badge--holiday { background: rgba(251, 191, 36, 0.14); color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }

/* ---------- Hodiny ---------- */

.clock__time {
  font-size: clamp(3.2rem, 9vw, 5.6rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.clock__seconds { color: var(--muted); font-size: 0.5em; font-weight: 600; }

.clock__date {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 1.05rem;
  text-transform: capitalize;
}

.clock__names { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }

.clock__nameday { display: flex; align-items: baseline; gap: 8px; font-size: 1.05rem; }
.clock__nameday strong { font-size: 1.35rem; font-weight: 700; color: var(--accent); }
.clock__nameday-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.clock__nameday--next { color: var(--text); }
.clock__nameday--muted { color: var(--muted); }

/* ---------- Počasí ---------- */

.weather__now { display: flex; align-items: center; gap: 14px; }
.weather__icon { font-size: 3.2rem; line-height: 1; }
.weather__temp { font-size: 3rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.weather__summary { display: flex; flex-direction: column; color: var(--text); font-size: 1.05rem; }
.weather__summary small { color: var(--muted); font-size: 0.85rem; }

.weather__meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}
.weather__updated { margin-left: auto; }

.forecast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.forecast__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.06);
}
.forecast__dow { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.forecast__icon { font-size: 1.6rem; }
.forecast__pop { font-size: 0.75rem; color: var(--muted); }
.forecast__pop.is-rainy { color: var(--accent); }
.forecast__temp { display: flex; gap: 6px; align-items: baseline; font-variant-numeric: tabular-nums; }
.forecast__temp span { color: var(--muted); font-size: 0.85rem; }

/* ---------- Radar ---------- */

.radar__map {
  height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0f1a;
  z-index: 1;
}

.radar__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.radar__label { color: var(--muted); font-size: 0.9rem; margin-left: auto; }

.leaflet-container { font: inherit; background: #0a0f1a; }

/* ---------- Poznámky ---------- */

.note-form { display: flex; flex-direction: column; gap: 8px; }
.note-form__row { display: flex; gap: 8px; justify-content: space-between; align-items: center; }

.notes__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.note {
  border-radius: 12px;
  padding: 10px 12px;
  color: #10202f;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 90px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.note--zluta { background: linear-gradient(160deg, #fde68a, #fcd34d); }
.note--zelena { background: linear-gradient(160deg, #bbf7d0, #86efac); }
.note--modra { background: linear-gradient(160deg, #bfdbfe, #93c5fd); }
.note--ruzova { background: linear-gradient(160deg, #fbcfe8, #f9a8d4); }

.note__text { margin: 0; white-space: pre-wrap; word-break: break-word; flex: 1; }
.note__edit {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 6px;
  font: inherit;
  color: #10202f;
  resize: vertical;
}
.note__foot { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; color: rgba(16, 32, 47, 0.65); }
.note__actions { display: flex; gap: 2px; }
.note .icon-btn { color: rgba(16, 32, 47, 0.7); }
.note .icon-btn:hover { background: rgba(16, 32, 47, 0.12); color: #10202f; }
.note .btn { background: #10202f; color: #e6edf7; }
.note .btn--ghost { background: transparent; border-color: rgba(16, 32, 47, 0.4); color: #10202f; }

/* ---------- Připomínky ---------- */

.rem-form { display: flex; flex-direction: column; gap: 8px; }
.rem-form__row { display: flex; gap: 8px; flex-wrap: wrap; }
.rem-form__row > * { flex: 1 1 auto; min-width: 90px; }
.rem-form__row .btn { flex: 0 0 auto; min-width: 90px; }
.rem-form__title { flex: 1 1 100% !important; }

.reminders__list { display: flex; flex-direction: column; gap: 8px; }

.reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.07);
  border-left: 3px solid transparent;
}
.reminder__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reminder__main strong { font-weight: 650; overflow-wrap: anywhere; }
.reminder__when { color: var(--muted); font-size: 0.85rem; }
.reminder__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.reminder.is-due {
  border-left-color: var(--warn);
  background: rgba(251, 191, 36, 0.12);
  animation: pulse 1.6s ease-in-out infinite;
}

.reminders__done { margin-top: 6px; }
.reminders__done h3,
.waste__past h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 6px;
}
.reminder--done { opacity: 0.55; animation: none; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}

/* ---------- Odpad ---------- */

.waste-form__row { display: flex; gap: 8px; flex-wrap: wrap; }
.waste-form__row > * { flex: 1 1 auto; min-width: 110px; }
.waste-form__row .btn { flex: 0 0 auto; }

.waste__list { display: flex; flex-direction: column; gap: 8px; }

.waste-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.07);
}
.waste-item__icon { font-size: 1.3rem; }
.waste-item__type { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.waste-item__type small { color: var(--muted); font-size: 0.78rem; }
.waste-item__date {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.waste-item.is-soon { background: rgba(52, 211, 153, 0.14); border-left: 3px solid var(--ok); }
.waste-item.is-soon .waste-item__date { color: var(--ok); font-weight: 650; }
.waste-item--past { opacity: 0.5; }
.waste__past { margin-top: 6px; }

/* ---------- Rádio ---------- */

.radio__stations { display: flex; flex-wrap: wrap; gap: 8px; }
.radio__station {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
.radio__station:hover { border-color: var(--accent); }
.radio__station.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent);
  color: var(--accent);
}

.radio__controls { display: flex; align-items: center; gap: 12px; }
.radio__controls input[type="range"] { flex: 1; accent-color: var(--accent); }
.radio__status { color: var(--muted); font-size: 0.9rem; }
.radio__status.is-error { color: var(--danger); }

/* ---------- Kamera ---------- */

.camera__frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #060a12;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
.camera__img, .camera__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- Vstupy ---------- */

input[type="text"], input[type="url"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], select, textarea {
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 9px 12px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 1px;
}
textarea { resize: vertical; width: 100%; }
input::placeholder, textarea::placeholder { color: rgba(147, 163, 184, 0.7); }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 17px; height: 17px; }

label.inline { color: var(--muted); font-size: 0.9rem; }

/* ---------- Nastavení ---------- */

.settings {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings__head { display: flex; align-items: baseline; gap: 14px; }
.settings__head h1 { font-size: 1.6rem; }
.settings__saved { color: var(--ok); font-weight: 650; }

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h2 { font-size: 1.05rem; }
.card details summary { cursor: pointer; color: var(--accent); }

.hint { color: var(--muted); font-size: 0.9rem; margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 0.85rem; color: var(--muted); }
.field__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field__row input { flex: 1 1 140px; }

.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.results__item {
  width: 100%;
  text-align: left;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 9px 12px;
  cursor: pointer;
}
.results__item:hover { border-color: var(--accent); background: rgba(56, 189, 248, 0.12); }

.tile-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tile-list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
}
.tile-list__row:hover { background: rgba(148, 163, 184, 0.07); }
.tile-list__move { display: flex; gap: 2px; }

.station-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* ---------- Patička ---------- */

.pagefoot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 10px clamp(14px, 3vw, 28px) 26px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ---------- Noční režim (ztlumení) ---------- */

body.night::after {
  content: "";
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0.52;
  pointer-events: none;
  z-index: 999;
}
body.night .clock__time { color: #cbd5e1; }
body.night .clock__seconds { color: #64748b; }
body.night .badge--holiday { color: #d9a441; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Malé obrazovky ---------- */

@media (max-width: 560px) {
  .forecast { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .weather__temp { font-size: 2.4rem; }
  .station-row { grid-template-columns: 1fr; }
  .radar__map { height: 260px; }
}
