/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f1428;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(14px, 3.5vw, 18px);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ── HARTA FULLSCREEN ── */
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ── PILL STATUS - centru sus ── */
.pill {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(15, 20, 40, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  font-size: 0.78rem;
  color: rgba(210, 220, 255, 0.9);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green  { background: #4ade80; }
.dot-amber  { background: #fbbf24; }
.dot-red    { background: #f87171; }

/* ── BUTOANE OVERLAY ── */
.btn {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(15, 20, 40, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: #c8d4ff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, transform 0.1s;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.btn:active {
  background: rgba(40, 55, 100, 0.92);
  transform: scale(0.94);
}

.btn svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

/* pozițiile celor 6 butoane */
.btn-tl { top: 12px;  left: 12px; }
.btn-tr { top: 12px;  right: 12px; }

.btn-ml { top: 50%;   left: 12px;  transform: translateY(-50%); }
.btn-mr { top: 50%;   right: 12px; transform: translateY(-50%); }

.btn-bl { bottom: 12px; left: 12px; }
.btn-br { bottom: 12px; right: 12px; }

/* active states pentru butoanele cu transform existent */
.btn-ml:active { transform: translateY(-50%) scale(0.94); }
.btn-mr:active { transform: translateY(-50%) scale(0.94); }

/* ── BARA ZOOM - centru jos ── */
.zoom-bar {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  background: rgba(15, 20, 40, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.z-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #c8d4ff;
  background: transparent;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  transition: background 0.15s;
  flex-shrink: 0;
}

.z-btn:active {
  background: rgba(40, 55, 100, 0.92);
}

.z-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.z-sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

/* ── OVERLAY LIGHTBOX ── */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.lb-overlay.ov-open {
  background: rgba(0, 0, 0, 0.55);
  opacity: 1;
  pointer-events: all;
}

/* ── LIGHTBOX CARD ── */
.lightbox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 30;
  width: calc(100% - 24px);
  max-width: 420px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
  outline: none;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
}

.lightbox.lb-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 0.5px solid #e8ecf4;
  flex-shrink: 0;
}

.lb-title {
  font-size: 1rem;
  font-weight: 500;
  color: #1a2040;
}

.lb-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  border: none;
  cursor: pointer;
  color: #ffffff;
  border-radius: 10px;
  transition: background 0.15s, transform 0.1s;
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
}

.lb-close:active {
  background: #dc2626;
  transform: scale(0.94);
}

.lb-close svg {
  width: 20px;
  height: 20px;
  display: block;
}

.lb-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── RÂNDURI ALERTE ── */
.alert-row {
  border-radius: 8px;
  padding: 9px 12px;
}

.alert-name {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-desc {
  font-size: 0.75rem;
  opacity: 0.85;
}

.alert-red   { background: #fff0f0; color: #9b1c1c; }
.alert-amber { background: #fffbeb; color: #78350f; }
.alert-green { background: #f0fdf4; color: #14532d; }

/* ── TEXT LIGHTBOX ── */
.lb-text {
  font-size: 0.85rem;
  line-height: 1.65;
  color: #2d3a5c;
}

.lb-lorem { color: #8892b0; font-style: italic; }

.lb-meta {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 0.5px solid #e8ecf4;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lb-meta span {
  font-size: 0.72rem;
  color: #8892b0;
}

/* ── FOOTER LIGHTBOX ALERTE ── */
.lb-foot {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px 14px;
  border-top: 0.5px solid #e8ecf4;
  flex-shrink: 0;
}

.lb-foot span {
  font-size: 0.7rem;
  color: #8892b0;
}

/* ── LEAFLET OVERRIDE ── */
.leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(15, 20, 40, 0.65) !important;
  color: rgba(180, 190, 220, 0.8) !important;
  border-radius: 4px 0 0 0 !important;
}

.leaflet-control-attribution a {
  color: rgba(160, 180, 255, 0.85) !important;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .btn, .z-btn, .lightbox, .lb-overlay {
    transition: none;
  }
}