* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, sans-serif; }
#map { height: 100%; }
.hidden { display: none !important; }

/* Dugmad na dnu ekrana */
#akcije {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.dugme {
  padding: 14px 22px; font-size: 16px; border: none; border-radius: 999px;
  background: #2e7d32; color: white; box-shadow: 0 2px 8px rgba(0,0,0,.3);
  cursor: pointer; white-space: nowrap;
}
#prijavi { background: #c62828; font-size: 17px; padding: 16px 28px; }
.dugme:disabled { opacity: .5; cursor: default; }
.dugme.sporedno { background: white; color: #333; }

/* Izbor lokacije u upitniku */
.lokacija-dugmad { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dugme-lokacija {
  padding: 12px 10px; font: inherit; font-size: 15px; font-weight: 600;
  border: 2px solid #2e7d32; border-radius: 12px; background: white; color: #2e7d32; cursor: pointer;
}
.dugme-lokacija.izabrano { background: #2e7d32; color: white; }
#koordinate.izabrana { color: #2e7d32; font-weight: 600; }

/* Biranje lokacije na mapi */
#biranje {
  position: absolute; left: 12px; right: 12px; bottom: 24px; z-index: 1001;
  max-width: 480px; margin: 0 auto; background: white; border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.3); padding: 14px; text-align: center;
}
#biranje p { margin: 0 0 12px; font-size: 15px; }
.biranje-dugmad { display: flex; gap: 10px; justify-content: center; }
.biranje-dugmad .dugme { flex: 1; padding: 12px 10px; }

/* Panel sa formom (izlazi odozdo) */
#panel, #panel-volonter {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1001;
  max-width: 600px; margin: 0 auto; max-height: 85vh; overflow-y: auto;
  background: white; border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,.25); padding: 16px;
}
.panel-zaglavlje { display: flex; justify-content: space-between; align-items: center; }
.panel-zaglavlje h2 { margin: 0; font-size: 20px; }
#zatvori, #zatvori-volonter {
  background: none; border: none; padding: 6px; cursor: pointer; color: #333;
  display: flex; align-items: center;
}
.sitno { color: #666; font-size: 13px; margin: 4px 0 12px; }

/* Grupe opcija */
fieldset { border: none; padding: 0; margin: 0 0 14px; }
legend { font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; padding: 8px 12px; font-size: 14px;
  border: 1px solid #bbb; border-radius: 999px; cursor: pointer; user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: #2e7d32; border-color: #2e7d32; color: white; }
.chip.opasno:has(input:checked) { background: #c62828; border-color: #c62828; }

/* Tekstualna polja */
.polje { display: block; font-weight: 600; margin-bottom: 14px; }
.polje textarea, .polje input {
  display: block; width: 100%; margin-top: 6px; padding: 10px;
  font: inherit; font-weight: normal; border: 1px solid #bbb; border-radius: 8px;
}
.posalji { width: 100%; }

/* Fotografije */
#pregled-slika { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.slika { position: relative; width: 80px; height: 80px; }
.slika img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.slika button {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px;
  border: none; border-radius: 50%; background: #c62828; color: white;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.slika button svg { width: 12px; height: 12px; }
.dodaj-sliku { display: inline-block; }

/* Prijave koje čekaju slanje */
#na-cekanju {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: #ef6c00; color: white; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.3); white-space: nowrap;
}
/* Javna mapa: legenda i oblačići */
.legenda {
  background: rgba(255,255,255,.95); padding: 8px 10px; border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.25); font-size: 12px; line-height: 1.6;
  display: flex; flex-direction: column;
}
.legenda i {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: -1px; border: 1px solid #fff;
}
.oblacic { font-size: 13px; line-height: 1.5; }
.oblacic-naslov { font-weight: 700; margin-bottom: 2px; }
.oblacic-sitno { color: #666; font-size: 12px; }

/* Dugme i forma za volontere */
#volontiraj {
  position: absolute; left: 12px; bottom: 44px; z-index: 1000;
  padding: 10px 16px; border: none; border-radius: 999px;
  background: #1565c0; color: white; font: inherit; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer;
}
#volontiraj .dugi { display: none; }
@media (max-width: 699px) {
  #volontiraj { bottom: 96px; }
}
@media (min-width: 700px) {
  #volontiraj { padding: 12px 18px; font-size: 15px; }
  #volontiraj .kratki { display: none; }
  #volontiraj .dugi { display: inline; }
}
.dva-polja { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.saglasnost { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 14px; }
.saglasnost input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
