/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; }

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  z-index: 1000;
  flex-shrink: 0;
}
.header__title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}
.header__subtitle {
  font-size: 13px;
  color: #888;
  margin-left: 8px;
}
.header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Stats */
.stats { display: flex; gap: 12px; font-size: 13px; color: #555; }
.stats__item { white-space: nowrap; }

/* Language switcher */
.lang-switcher { display: flex; gap: 4px; }
.lang-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: #888; color: #333; }
.lang-btn.active { background: #333; color: #fff; border-color: #333; }

/* ---- Map ---- */
#map { flex: 1; z-index: 1; }

/* ---- Marker popup ---- */
.popup { width: 200px; }
.popup__photo {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 4px;
  background: #eee;
}
.popup__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
}
.popup__date { color: #888; }
.popup__link { color: #2563eb; text-decoration: none; }
.popup__link:hover { text-decoration: underline; }

/* ---- Photo markers ---- */
.photo-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  overflow: hidden;
  cursor: pointer;
  background: #e9e9e9;
}
.photo-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-marker--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

/* ---- Leaflet cluster overrides ---- */
.marker-cluster-small { background-color: rgba(181, 226, 140, 0.6); }
.marker-cluster-small div { background-color: rgba(110, 204, 57, 0.6); }
.marker-cluster-medium { background-color: rgba(241, 211, 87, 0.6); }
.marker-cluster-medium div { background-color: rgba(240, 194, 12, 0.6); }
.marker-cluster-large { background-color: rgba(253, 156, 115, 0.6); }
.marker-cluster-large div { background-color: rgba(241, 128, 23, 0.6); }

/* ---- Loading indicator ---- */
.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.9);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  color: #555;
  z-index: 1001;
  pointer-events: none;
}

/* ---- Sighting page ---- */
.sighting {
  flex: 1;
  overflow-y: auto;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}
.sighting__loading,
.sighting__error {
  text-align: center;
  padding: 48px 16px;
  color: #888;
  font-size: 15px;
}
.sighting__error { color: #c00; }

/* Gallery */
.gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 8px;
}
.gallery__img {
  flex-shrink: 0;
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  scroll-snap-align: start;
  cursor: pointer;
  background: #eee;
}

/* Info */
.sighting__info { margin-top: 12px; }
.sighting__meta {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: #666;
}
.sighting__dogs { font-weight: 600; }
.sighting__desc {
  margin-top: 8px;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

/* Mini-map */
.sighting__map {
  height: 200px;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
}

/* Actions */
.sighting__actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn--primary { background: #2563eb; color: #fff; }
.btn--primary:hover { background: #1d4ed8; }
.btn--secondary { background: #f3f4f6; color: #333; }
.btn--secondary:hover { background: #e5e7eb; }
.btn--danger { background: none; color: #dc2626; border: 1px solid #dc2626; }
.btn--danger:hover { background: #fef2f2; }
.btn--danger:disabled { opacity: 0.5; cursor: default; }

/* Complaint form */
.complaint-form {
  margin-top: 12px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
}
.complaint-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #555;
}
.complaint-form select,
.complaint-form textarea {
  display: block;
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 8px;
}
.complaint-form textarea { resize: vertical; }
.complaint-form__result { font-size: 13px; margin-top: 6px; }
.complaint-form__result--ok { color: #16a34a; }
.complaint-form__result--err { color: #dc2626; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox__img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}
.lightbox__counter {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  background: rgba(0,0,0,0.5);
  padding: 4px 12px;
  border-radius: 12px;
}

/* ---- Rules page ---- */
.rules {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
}
.rules__title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}
.rules__content ol {
  padding-left: 24px;
  line-height: 1.8;
  color: #444;
  font-size: 15px;
}
.rules__content li {
  margin-bottom: 8px;
}
.rules__actions {
  margin-top: 24px;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .header { padding: 6px 10px; }
  .header__title { font-size: 16px; }
  .header__subtitle { display: none; }
  .stats { font-size: 12px; gap: 8px; }
}
