/* ============ FONTS & RESET ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a26;
  --border: #1e1e30;
  --text: #e0e0e8;
  --text-dim: #6b6b80;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --military: #e74c3c;
  --pilot: #3498db;
  --radar: #f39c12;
  --multiple: #2ecc71;
  --historical: #9b59b6;
  --verified: #2ecc71;
  --probable: #f39c12;
  --explained: #95a5a6;
  --discarded: #e74c3c;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html, body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ LAYOUT ============ */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ============ SIDEBAR ============ */
#sidebar {
  width: 420px;
  min-width: 420px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2px;
}

.stats-row {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.stat {
  flex: 1;
  text-align: center;
}

.stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ============ LISTA DE AVISTAMIENTOS ============ */
.sightings-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sightings-list::-webkit-scrollbar { width: 4px; }
.sightings-list::-webkit-scrollbar-track { background: transparent; }
.sightings-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sighting-item {
  padding: 14px 24px;
  border-bottom: 1px solid rgba(30, 30, 48, 0.5);
  cursor: pointer;
  transition: background var(--transition);
}

.sighting-item:hover { background: var(--bg-card-hover); }
.sighting-item.active { background: rgba(108, 92, 231, 0.1); border-left: 3px solid var(--accent); }

.sighting-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sighting-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.sighting-date {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.sighting-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-military { background: rgba(231, 76, 60, 0.15); color: var(--military); }
.badge-pilot { background: rgba(52, 152, 219, 0.15); color: var(--pilot); }
.badge-radar { background: rgba(243, 156, 18, 0.15); color: var(--radar); }
.badge-multiple { background: rgba(46, 204, 113, 0.15); color: var(--multiple); }
.badge-historical { background: rgba(155, 89, 182, 0.15); color: var(--historical); }

.badge-verified { background: rgba(46, 204, 113, 0.15); color: var(--verified); }
.badge-probable { background: rgba(243, 156, 18, 0.15); color: var(--probable); }
.badge-explained { background: rgba(149, 165, 166, 0.15); color: var(--explained); }
.badge-discarded { background: rgba(231, 76, 60, 0.15); color: var(--discarded); }

.sighting-location {
  font-size: 12px;
  color: var(--text-dim);
}

/* ============ MAPA ============ */
#map-container {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

/* ============ OVERLAYS ============ */
.map-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  z-index: 5;
  pointer-events: auto;
}

.overlay-title {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-military { background: var(--military); box-shadow: 0 0 6px var(--military); }
.dot-pilot { background: var(--pilot); box-shadow: 0 0 6px var(--pilot); }
.dot-radar { background: var(--radar); box-shadow: 0 0 6px var(--radar); }
.dot-multiple { background: var(--multiple); box-shadow: 0 0 6px var(--multiple); }
.dot-historical { background: var(--historical); box-shadow: 0 0 6px var(--historical); }

/* ============ POPUP ============ */
.popup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-width: 280px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.popup-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.popup-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.popup-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 8px;
}

.popup-source {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============ PURSUE BANNER ============ */
.pursue-banner {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: linear-gradient(135deg, rgba(108,92,231,0.1), rgba(0,0,0,0.8));
  border: 1px solid rgba(108,92,231,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  z-index: 5;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pursue-banner-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 4px;
}

.pursue-banner-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.pursue-banner-text a {
  color: var(--accent);
  font-weight: 500;
}

/* ============ FILTER CHIPS ============ */
.filter-row {
  display: flex;
  gap: 6px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-chip {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ============ INFO PANEL ============ */
.info-panel {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}

.info-panel strong {
  color: var(--text);
}

/* ============ PULSE ANIMATION ============ */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 10px rgba(108, 92, 231, 0); }
  100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}

.pulse-marker {
  animation: pulse 2s infinite;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  #app { flex-direction: column; }
  #sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  #map-container { flex: 1; }
}
