:root {
  --font-family: 'Inter', sans-serif;
  --page-bg: #f4f6fb;
  --text-primary: #0f172a;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-bg-strong: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.5);
  --pane-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  --legend-border: rgba(0, 0, 0, 0.1);
  --table-border: rgba(15, 23, 42, 0.08);
  --table-stripe: rgba(15, 23, 42, 0.02);
  --backdrop-bg: rgba(148, 163, 184, 0.35);
  --transition: 0.2s ease-in-out;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--page-bg);
  color: var(--text-primary);
}

#map {
  width: 100%;
  height: 100vh;
}

.legend .color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
  border: 1px solid var(--legend-border);
}

.color.good {
  background: #00e400;
}
.color.moderate {
  background: #ffff00;
}
.color.unhealthy {
  background: #ff7e00;
}
.color.very-unhealthy {
  background: #ff0000;
}

.sensor-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: block;
  box-shadow: 0 2px 4px rgba(65, 38, 38, 0.3);
  transition: width 0.3s ease, height 0.3s ease, border 0.3s ease;
}

.sensor-marker.is-active {
  width: 32px;
  height: 32px;
  border-color: rgba(255, 255, 255, 0.9);
}

/* .sensor-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: width 0.3s ease, height 0.3s ease, border 0.3s ease;
}

.sensor-marker.is-active {
  width: 32px;
  height: 32px;
  border-color: rgba(255, 255, 255, 0.9);
} */

#focus-panel {
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

#focus-panel[style*="display: flex"],
#focus-panel[style*="opacity: 1"] {
  pointer-events: auto;
}

.focus-image-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  padding: 0.5rem;
}

.focus-thumb {
  width: 100%;
  height: 160px;
  border-radius: 0.5rem;
  object-fit: contain;
  background: var(--glass-bg-strong);
  padding: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.focus-thumb:hover {
  transform: scale(1.02);
}

.image-modal,
.details-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.image-modal {
  z-index: 50;
}

.image-modal.hidden,
.details-modal.hidden {
  display: none;
}

.image-modal-backdrop,
.details-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop-bg);
}

.image-modal-content,
.details-modal-content {
  position: relative;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 1);
  color: var(--text-primary);
  box-shadow: var(--pane-shadow);
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  padding: 1rem;
}

.details-modal-content {
  width: min(90vw, 900px);
}

.image-modal-content img {
  max-width: 85vw;
  max-height: 70vh;
  border-radius: 0.75rem;
  object-fit: contain;
  background: #fff;
  padding: 0.5rem;
}

.image-modal-close,
.details-modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.image-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
}

.image-modal-close:hover,
.details-modal-close:hover {
  color: var(--text-primary);
}

.details-table-wrapper {
  border-radius: 0.75rem;
  border: 1px solid var(--table-border);
  background: rgba(248, 250, 252, 0.7);
  overflow: auto;
  max-height: 70vh;
}

.details-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.details-table-wrapper thead {
  position: sticky;
  top: 0;
  background: rgba(226, 232, 240, 0.95);
  backdrop-filter: blur(4px);
}

.details-table-wrapper th,
.details-table-wrapper td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  white-space: nowrap;
}

.details-table-wrapper tbody tr:nth-child(odd) {
  background: var(--table-stripe);
}
