:root {
  --accent-color: #2563eb;
  --accent-light: #dbeafe;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--pico-background-color);
  color: var(--pico-color);
}

div#map {
  width: 50%;
  height: 100vh;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background-color: #0b1120;
}

main.container {
  width: 50%;
  min-height: 100vh;
  padding: 1.5rem;
  box-sizing: border-box;
}

.header {
  margin-bottom: 1.25rem;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.title-row h1 {
  margin-bottom: 0.25rem;
  font-size: 1.85rem;
}

.theme-btn {
  padding: 0.35rem 0.65rem;
  font-size: 1.1rem;
  border-radius: 9999px;
  cursor: pointer;
  width: auto;
  margin-bottom: 0;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--pico-muted-color);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Card styling */
.card {
  margin-bottom: 1.25rem;
  padding: 1.15rem;
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  box-shadow: var(--pico-card-box-shadow);
  border: 1px solid var(--pico-card-border-color, rgba(125, 125, 125, 0.15));
}

.card header {
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pico-card-border-color, rgba(125, 125, 125, 0.15));
}

.card-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-btn {
  display: inline;
  width: fit-content;
  padding: 0.2rem 0.5rem;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--pico-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.link-btn:hover {
  color: var(--pico-primary-hover);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.coord-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: var(--pico-primary-background);
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.hint {
  display: block;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--pico-muted-color);
}

.toggles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--pico-card-border-color, rgba(125, 125, 125, 0.15));
}

.checkbox-label {
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

/* Highlight Scale Card */
.highlight-card {
  border-left: 4px solid var(--pico-primary);
}

.scale-banner {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  background: var(--pico-code-background-color);
  padding: 0.85rem 1rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1rem;
}

.scale-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.scale-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pico-primary);
}

.scale-desc {
  font-size: 0.86rem;
  color: var(--pico-color);
  margin-top: 0.2rem;
}

/* Stats table */
.stats-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.75rem;
  background: var(--pico-code-background-color);
  border-radius: var(--pico-border-radius);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0.15rem;
  color: var(--pico-color);
}

/* MapLibre Controls Customization */
.maplibregl-ctrl-group {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.maplibregl-popup-content {
  border-radius: 8px;
  font-size: 0.85rem;
  padding: 10px 14px;
}

/* Responsive behavior */
@media only screen and (max-width: 900px) {
  body {
    flex-direction: column;
  }

  div#map {
    width: 100%;
    height: 48vh;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  main.container {
    width: 100%;
    min-height: auto;
    padding: 1rem;
  }

  .stats-table {
    grid-template-columns: 1fr;
  }
}
