* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  pointer-events: none;
}

#topbar h1 {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#topbar .accent { color: #38bdf8; }

#tower-count {
  font-size: 0.65rem;
  font-weight: 400;
  color: #64748b;
  vertical-align: middle;
}

#search {
  pointer-events: auto;
  flex: 1;
  max-width: 20rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.5rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  color: #e2e8f0;
  outline: none;
}

#search:focus { border-color: #38bdf8; }
#search::placeholder { color: #64748b; }

#controls {
  position: absolute;
  bottom: 1.25rem;
  left: 0.75rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
}

.operator-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.operator-toggles label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}

/* Official operator brand colors */
.dot.cyta { background: #007b4e; }
.dot.epic { background: #ffd700; }
.dot.primetel { background: #d50057; }
.dot.cablenet { background: #7b00e0; }

#band-select {
  width: 100%;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
}

#locate-btn,
#about-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}

#locate-btn:hover,
#about-btn:hover { background: #334155; }

/* About & sources dialog */
#about {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(2px);
}

#about[hidden] { display: none; }

#about-panel {
  position: relative;
  max-width: 34rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
  line-height: 1.55;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

#about-panel h2 { font-size: 1.05rem; margin-bottom: 0.6rem; }
#about-panel h3 { font-size: 0.9rem; margin: 0.9rem 0 0.35rem; color: #38bdf8; }
#about-panel p { margin-bottom: 0.6rem; }
#about-panel ul { padding-left: 1.1rem; }
#about-panel li { margin-bottom: 0.5rem; }
#about-panel a { color: #38bdf8; }
#about-panel .about-footer {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  color: #94a3b8;
}

#about-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  cursor: pointer;
}

#about-close:hover { background: #334155; }

.tower-popup { font-size: 0.85rem; line-height: 1.45; }
.tower-popup .station { font-weight: 700; font-size: 0.95rem; }
.tower-popup .operator-cyta { color: #007b4e; }
.tower-popup .operator-epic { color: #b89b00; }
.tower-popup .operator-primetel { color: #d50057; }
.tower-popup .networks { font-weight: 600; }
.tower-popup .bands { color: #475569; font-size: 0.75rem; }

.tower-popup .photos {
  display: flex;
  gap: 0.3rem;
  margin: 0.4rem 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.2rem;
}

.tower-popup .photos img {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border-radius: 0.25rem;
  flex-shrink: 0;
  scroll-snap-align: start;
  cursor: zoom-in;
}

/* In-app photo lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(2px);
}

#lightbox[hidden] { display: none; }

#lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 7rem);
  max-height: 100vh;
}

#lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 0.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

#lightbox figcaption {
  font-size: 0.85rem;
  color: #cbd5e1;
}

#lightbox figcaption #lb-station { font-weight: 700; color: #e2e8f0; }

#lightbox button {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

#lightbox button:hover { background: #334155; }
#lightbox button:disabled { opacity: 0.3; cursor: default; }

#lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.4rem;
}

@media (max-width: 640px) {
  #lightbox { gap: 0.25rem; }
  #lightbox figure { max-width: calc(100vw - 5.5rem); }
}
