/* Styles for the timelapse viewer. Light theme matching zagreb.lol; mobile-first. */
* { box-sizing: border-box; }
body {
  margin: 0; background: #f7f6f2; color: #1d1f24;
  font-family: -apple-system, system-ui, sans-serif;
}
header { padding: 12px 16px 0; max-width: 1280px; margin: 0 auto; }
h1 { font-size: 18px; margin: 0 0 10px; font-weight: 600; }
#tabs { display: flex; flex-wrap: wrap; gap: 6px; }
#tabs button {
  border: 1px solid #d8d4c8; background: #ffffff; color: #3c4046;
  padding: 6px 12px; border-radius: 999px; font-size: 14px; cursor: pointer;
}
#tabs button.active { background: #3d6df2; border-color: #3d6df2; color: #fff; }
main { max-width: 1280px; margin: 0 auto; padding: 10px 16px 24px; }
#picker-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
#picker {
  font-size: 15px; padding: 6px 8px; border-radius: 6px;
  background: #ffffff; color: #1d1f24; border: 1px solid #d8d4c8; max-width: 100%;
}
#picker.hidden { display: none; }
#speed { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.ctl-label { font-size: 12px; color: #8f8b80; margin-right: 2px; }
#speed button {
  border: 1px solid #d8d4c8; background: #ffffff; color: #3c4046;
  padding: 4px 8px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
#speed button.active { background: #3d6df2; border-color: #3d6df2; color: #fff; }
#player { width: 100%; border-radius: 8px; background: #000; display: block; }
#info { margin-top: 8px; font-size: 14px; color: #5a5e66; }
#hint { margin-top: 4px; font-size: 12px; color: #8f8b80; }
@media (max-width: 480px) {
  header, main { padding-left: 10px; padding-right: 10px; }
  #speed { margin-left: 0; }
}
#subtitle { font-size: 14px; color: #5a5e66; margin: 0 0 10px; }
#source { margin-top: 10px; font-size: 12px; color: #8f8b80; }
footer {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #ded9cc;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px;
}
#home-link { display: flex; align-items: center; gap: 8px; color: #5a5e66; text-decoration: none; }
#home-link img { width: 26px; height: 26px; border-radius: 6px; }
#home-link:hover { color: #000; }
.site-link {
  border: 1px solid #d8d4c8; background: #ffffff; color: #3c4046; text-decoration: none;
  padding: 4px 10px; border-radius: 999px;
}
.site-link:hover { border-color: #3d6df2; color: #3d6df2; }
#source a { color: #4a6ec4; }

/* main tabs (Snimke / Analize) */
#main-tabs { display: flex; gap: 0; border-bottom: 1px solid #ded9cc; }
#main-tabs button {
  border: 0; border-bottom: 3px solid transparent; background: none; color: #5a5e66;
  padding: 8px 14px; font-size: 15px; cursor: pointer; margin-bottom: -1px;
}
#main-tabs button.active { color: #1d1f24; border-bottom-color: #3d6df2; font-weight: 600; }
#panel-snimke #tabs { margin-bottom: 10px; }

/* Analize */
#panel-analize h2 { font-size: 17px; margin: 28px 0 6px; font-weight: 600; }
#panel-analize h3 { font-size: 14px; margin: 8px 0 4px; font-weight: 600; color: #3c4046; }
.an-desc { font-size: 14px; color: #5a5e66; margin: 0 0 10px; line-height: 1.45; }
.an-desc code { font-size: 13px; background: #efede6; padding: 0 4px; border-radius: 3px; }
#heat-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
#heat-views { display: flex; gap: 4px; }
#heat-views button {
  border: 1px solid #d8d4c8; background: #ffffff; color: #3c4046;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
#heat-views button.active { background: #3d6df2; border-color: #3d6df2; color: #fff; }
#heat-slider-row { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 220px; }
#heat-slider { flex: 1; accent-color: #3d6df2; }
#heat-slot-label { font-size: 13px; color: #3c4046; min-width: 120px; }
.heat-wrap { overflow-x: auto; border-radius: 8px; background: #e9e7e0; }
.heat-stack { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.heat-stack img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 700px) { .heat-stack { width: 1100px; } }
#heat-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8f8b80; margin-top: 6px; }
.heat-bar {
  width: 160px; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, #96cdaf 0%, #fad246 15%, #fa8c28 35%, #e1372d 60%, #640a0f 100%);
}
.two-col { display: grid; grid-template-columns: 1fr; gap: 6px 24px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e3e0d6; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: #5a5e66; }
.chart .tick.sub { fill: #a3a096; font-size: 10px; }
.table-wrap { overflow-x: auto; }
.league { border-collapse: collapse; font-size: 13px; width: 100%; min-width: 640px; }
.league th { text-align: left; font-weight: 600; color: #5a5e66; padding: 4px 8px; border-bottom: 1px solid #ded9cc; white-space: nowrap; }
.league td { padding: 4px 8px; border-bottom: 1px solid #ece9e0; white-space: nowrap; vertical-align: middle; }
.league td.num { text-align: right; font-variant-numeric: tabular-nums; position: relative; min-width: 96px; }
.league td .bar { position: absolute; left: 4px; top: 5px; bottom: 5px; background: #f7c7bf; border-radius: 2px; }
.league td .v { position: relative; }  /* keeps the number readable on top of its bar */
.spark { width: 130px; height: 24px; display: block; }
.spark rect { fill: #3d6df2; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; background: #ffffff; border: 1px solid #ded9cc; border-radius: 8px; overflow: hidden; }
.gallery img { width: 100%; display: block; aspect-ratio: 16 / 9; }
.gallery figcaption { padding: 6px 8px; font-size: 12px; color: #5a5e66; line-height: 1.4; }

/* "Ulica po ulica": zoomed street crop + space-time grid */
#street-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
#street-picker {
  font-size: 15px; padding: 6px 8px; border-radius: 6px;
  background: #ffffff; color: #1d1f24; border: 1px solid #d8d4c8; max-width: 100%;
}
#street-meta { font-size: 13px; color: #8f8b80; }
#street-layout { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 900px) { #street-layout { grid-template-columns: 360px 1fr; } }
#street-map { margin: 0; }
.street-crop { position: relative; overflow: hidden; border-radius: 8px; background: #e9e7e0; width: 100%; }
.street-crop img { position: absolute; max-width: none; display: block; }
#street-map-caption { font-size: 12px; color: #8f8b80; margin-top: 6px; line-height: 1.4; }
#street-grid { overflow-x: auto; }
.stgrid { width: 100%; min-width: 560px; height: auto; display: block; }
.stgrid .tick { font-size: 11px; fill: #5a5e66; }
.stgrid .tick.sub { fill: #a3a096; font-size: 10px; }
.league tr.linked { cursor: pointer; }
.league tr.linked:hover td { background: #f0eee7; }
#street-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8f8b80; margin-top: 6px; flex-wrap: wrap; }
#street-legend .heat-bar { width: 120px; }
#street-legend .nodata { width: 14px; height: 10px; border-radius: 2px; background: #e6e3dc; margin-left: 8px; }
#street-legend .note { color: #a3a096; }
#street-dirs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
#street-dirs button {
  border: 1px solid #d8d4c8; background: #ffffff; color: #3c4046;
  padding: 3px 10px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
#street-dirs button.active { background: #3d6df2; border-color: #3d6df2; color: #fff; }
#calendar-basis { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
#calendar-basis button {
  border: 1px solid #d8d4c8; background: #ffffff; color: #3c4046;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
#calendar-basis button.active { background: #3d6df2; border-color: #3d6df2; color: #fff; }
#periods { margin-top: 12px; font-size: 13px; color: #5a5e66; }
#periods summary { cursor: pointer; padding: 4px 0; }
