/* Font Nunito Sans (SIL Open Font License, fonts/OFL-LICENSE.txt), lokalno umjesto Google Fontsa */
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("../fonts/nunito-sans-latin-ext-standard-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("../fonts/nunito-sans-latin-standard-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Vizualni identitet Općine Maruševec: boje iz grba i logotipa */
:root {
  --green: #006830;        /* natpis "marušEVEC" */
  --green-dark: #004d23;
  --leaf: #68c048;         /* listovi đurđice */
  --yellow: #f8e838;       /* štit */
  --ok: #0f8a3c;           /* oznake 1. faze na karti */
  --ok-soft: #e6f4ea;
  --ok-ink: #0b5e2e;
  --other: #8b95a5;
  --no-soft: #eef0f4;

  --bg: #ffffff;
  --bg-soft: #f5f7f6;
  --text: #17202e;
  --muted: #5b6676;
  --line: #e1e6e3;
  --focus: #1f6feb;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(16, 40, 24, .14);
  --panel-w: 390px;
  --topbar-h: 76px;

  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); overflow: hidden; }
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

/* ---------- zaglavlje ---------- */
.topbar {
  flex: none; height: var(--topbar-h);
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; background: var(--bg);
  border-bottom: 4px solid var(--yellow);
  box-shadow: inset 0 -2px 0 var(--green), 0 2px 10px rgba(0, 0, 0, .06);
  position: relative; z-index: 1500;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; }
.grb { height: 56px; width: auto; display: block; }
.logotip { height: 36px; width: auto; display: block; }
.topbar-title { display: flex; flex-direction: column; padding-left: 22px; border-left: 1px solid var(--line); min-width: 0; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
.topbar-title h1 { font-size: 22px; font-weight: 800; line-height: 1.2; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.phase-pill {
  font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: var(--yellow); color: var(--green-dark); padding: 3px 10px; border-radius: 999px;
}
.topbar-link {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  color: var(--green); font-weight: 700; font-size: 14px; text-decoration: none;
  padding: 8px 12px; border-radius: 8px;
}
.topbar-link svg { width: 16px; height: 16px; }
.topbar-link:hover { background: var(--ok-soft); }

/* ---------- raspored ---------- */
.app { flex: 1; display: flex; min-height: 0; }

.panel {
  width: var(--panel-w); flex: 0 0 var(--panel-w);
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: var(--bg);
  z-index: 1000;
}
.panel-body { flex: 1; overflow-y: auto; padding: 20px 20px 10px; display: flex; flex-direction: column; gap: 24px; }
.section-label { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* pretraživanje */
.hero h2 { font-size: 21px; font-weight: 800; color: var(--green-dark); }
.hero p { margin: 4px 0 12px; color: var(--muted); font-size: 15px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--green); pointer-events: none; }
.search-box input {
  width: 100%; padding: 13px 14px 13px 44px; font-size: 16px;
  border: 2px solid var(--green); border-radius: var(--radius); background: var(--bg);
}
.search-box input::placeholder { color: #8c96a3; }
.search-box input:focus { outline: 3px solid rgba(248, 232, 56, .9); outline-offset: 1px; }
.results {
  list-style: none; margin: 8px 0 0; padding: 4px; max-height: 320px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow);
}
.results li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.results li:hover, .results li[aria-selected="true"] { background: var(--bg-soft); }
.results .r-addr { display: flex; flex-direction: column; min-width: 0; font-weight: 700; }
.results .r-addr small { color: var(--muted); font-size: 13px; font-weight: 400; }
.results .empty { color: var(--muted); cursor: default; display: block; line-height: 1.45; }

.badge { flex: none; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge-no { background: var(--no-soft); color: var(--muted); }

/* sažetak */
.summary {
  display: flex; gap: 16px; align-items: center;
  background: var(--ok-soft); border-radius: var(--radius); padding: 16px 18px;
  border-left: 5px solid var(--leaf);
}
.summary .big { font-size: 38px; font-weight: 800; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.summary p { margin: 0; font-size: 14.5px; line-height: 1.45; }

/* kako se priključiti */
.info {
  border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius);
  padding: 16px 18px 18px; background: var(--bg); scroll-margin-top: 12px; outline: none;
}
.info.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--yellow); } 100% { box-shadow: 0 0 0 0 transparent; } }
.info h2 { font-size: 18px; font-weight: 800; color: var(--green-dark); margin-bottom: 8px; }
.info-uvod { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; }
.info-rok {
  display: flex; gap: 10px; align-items: center; margin: 0 0 12px; padding: 10px 12px;
  background: #fffbd6; border: 1px solid #f1e17a; border-radius: 10px; font-weight: 700; font-size: 14.5px; color: #5b4d00;
}
.info-rok svg { width: 20px; height: 20px; flex: none; color: #8a7500; }
.info-koraci { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: k; display: flex; flex-direction: column; gap: 10px; }
.info-koraci li { counter-increment: k; display: flex; gap: 10px; font-size: 14.5px; line-height: 1.45; }
.info-koraci li::before {
  content: counter(k); flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center;
}
.info-operater { margin: 0 0 12px; font-size: 14.5px; font-weight: 700; }
.info-operater span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.info-btn {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 16px;
  background: var(--green); color: #fff; font-weight: 800; font-size: 14.5px; text-decoration: none; border-radius: 10px;
}
.info-btn:hover { background: var(--green-dark); }
.info-btn svg { width: 18px; height: 18px; }
.info-kontakt { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--bg-soft); border-radius: 10px; font-size: 14.5px; }
.info-kontakt-naziv { font-weight: 800; }
.info-kontakt a, .info-kontakt span { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.info-kontakt a { color: var(--green); font-weight: 700; }
.info-kontakt a:hover { text-decoration: underline; }
.info-kontakt svg { width: 18px; height: 18px; flex: none; color: var(--green); }

/* naselja */
.naselja { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.naselja li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.naselja input { width: 18px; height: 18px; accent-color: var(--ok); margin: 0; cursor: pointer; flex: none; }
.naselja .n-name { flex: 1; font-size: 15px; font-weight: 700; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.naselja .n-name:hover { color: var(--green); text-decoration: underline; }
.naselja .n-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 38px; height: 22px; flex: none; border-radius: 999px; background: #c5ccd6; transition: background .15s; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* popis */
.popis details { border-bottom: 1px solid var(--line); }
.popis summary { cursor: pointer; padding: 11px 2px; font-weight: 700; font-size: 15px; display: flex; list-style: none; }
.popis summary::-webkit-details-marker { display: none; }
.popis summary::before { content: "▸"; color: var(--green); margin-right: 8px; transition: transform .15s; display: inline-block; }
.popis details[open] summary::before { transform: rotate(90deg); }
.popis summary .s-title { flex: 1; }
.popis summary .s-count { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.popis .ulica { font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 2px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 14px; }
.chip {
  min-width: 44px; padding: 5px 8px; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 1px solid #bfe2cb; background: var(--ok-soft); color: var(--ok-ink); border-radius: 7px; cursor: pointer;
}
.chip:hover, .chip:focus-visible { background: var(--ok); color: #fff; border-color: var(--ok); outline: none; }

/* podnožje panela */
.panel-foot { border-top: 1px solid var(--line); padding: 12px 20px; background: var(--bg-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.dot-ok { background: var(--ok); }
.dot-other { background: var(--other); width: 9px; height: 9px; border-width: 1px; }
.copyright { margin: 0; font-size: 12.5px; color: var(--muted); }
.verzija { margin-left: 6px; opacity: .7; font-variant-numeric: tabular-nums; }

/* ---------- karta ---------- */
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #e9ecef; }

.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10.5px; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 14px 16px; min-width: 220px; }
.pp-addr { font-weight: 800; font-size: 16px; }
.pp-sub { color: var(--muted); font-size: 13.5px; margin: 1px 0 10px; }
.pp-status { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.4; }
.pp-status strong { display: block; font-size: 14px; }
.pp-status svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.pp-status.ok { background: var(--ok-soft); color: var(--ok-ink); }
.pp-status.no { background: var(--no-soft); color: #3e4756; }
.pp-info-btn {
  margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border: 0; border-radius: 10px; background: var(--green); color: #fff;
  font-weight: 800; font-size: 14px; cursor: pointer;
}
.pp-info-btn:hover { background: var(--green-dark); }
.pp-info-btn svg { width: 17px; height: 17px; }

.naselje-label span {
  position: absolute; transform: translate(-50%, -50%);
  font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #1f3b2a;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; pointer-events: none;
}
.kb-label.leaflet-tooltip {
  background: rgba(255,255,255,.94); border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  padding: 0 4px; font-size: 11.5px; font-weight: 800; color: var(--ok-ink); border-radius: 4px;
}
.kb-label.other.leaflet-tooltip { color: #4a5464; font-weight: 700; }
.kb-label.leaflet-tooltip::before { display: none; }
.hide-kb-labels .kb-label:not(.other),
.hide-other-labels .kb-label.other,
.hide-naselje-labels .naselje-label { display: none; }

.map-btn { width: 34px; height: 34px; display: grid; place-items: center; background: #fff; border: 0; cursor: pointer; }
.map-btn svg { width: 18px; height: 18px; }
.map-btn:hover { background: #f4f4f4; }

.noscript { position: fixed; inset: auto 0 0 0; margin: 0; padding: 14px; background: var(--yellow); text-align: center; z-index: 3000; }

/* ---------- uži zasloni ---------- */
.icon-btn { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }
.only-mobile { display: none; }

@media (max-width: 1080px) {
  .topbar-link { display: none; }
}

@media (max-width: 860px) {
  .logotip { display: none; }
  .topbar-title { padding-left: 14px; }
}

@media (max-width: 767px) {
  :root { --topbar-h: 62px; }
  .topbar { padding: 0 14px; gap: 12px; }
  .grb { height: 44px; }
  .brand { gap: 0; }
  .topbar-title { padding-left: 12px; }
  .kicker { font-size: 11.5px; }
  .topbar-title h1 { font-size: 18px; gap: 8px; }
  .phase-pill { font-size: 11px; padding: 2px 8px; }

  .panel {
    position: fixed; inset: 0; width: 100%; border: 0;
    transform: translateY(100%); transition: transform .25s ease; z-index: 2000;
  }
  .panel.open { transform: none; }
  .panel-head.only-mobile {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 10px 10px 16px; border-bottom: 4px solid var(--yellow);
    box-shadow: inset 0 -2px 0 var(--green); font-weight: 800; font-size: 16px; color: var(--green-dark);
  }
  .panel-body { padding: 16px 16px 10px; }
  .panel-foot { padding-left: 16px; padding-right: 16px; }

  .fab.only-mobile {
    position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 1000;
    display: flex; align-items: center; gap: 8px; padding: 14px 22px; border: 0; border-radius: 999px;
    background: var(--green); color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap;
    box-shadow: 0 0 0 3px var(--yellow), var(--shadow); cursor: pointer;
  }
  .fab svg { width: 20px; height: 20px; }
}
