/* Tab switcher */
.wc-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border, #e0e0e0);
  margin-bottom: 1rem;
}

.wc-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-muted, #666);
}

.wc-tab.active,
.wc-tab[aria-selected='true'] {
  color: inherit;
  border-bottom-color: currentColor;
}

.wc-tab:hover {
  color: inherit;
}

/* make sure the map & the compass have enough room - reduce padding top, remove padding bottom */
.site-main:has(.wc-tabs) {
  padding-top: 1rem;
  padding-bottom: 0;
}

/* Map panel */
#toilet-map {
  height: 70vh;
  min-height: 400px;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Compass panel */
.compass-container {
  text-align: center;
}

#compass-radar {
  display: block;
  width: min(80vw, 320px);
  margin: 0 auto 0.5rem;
  color: #2b5b3c;
  transition: transform 0.4s ease-out;
}

#compass-radar svg {
  width: 100%;
  height: auto;
  display: block;
}

.radar-bg {
  fill: rgba(0, 0, 0, 0.04);
}

.radar-ring {
  fill: none;
  stroke: currentColor;
  stroke-opacity: 0.25;
  stroke-width: 0.6;
}

.radar-axis {
  stroke: currentColor;
  stroke-opacity: 0.15;
  stroke-width: 0.4;
  stroke-dasharray: 2 3;
}

.radar-card {
  fill: currentColor;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.6;
}

.radar-dist {
  fill: currentColor;
  font-size: 5px;
  opacity: 0.45;
}

.radar-sweep {
  transform-origin: 100px 100px;
  animation: radar-sweep 4s linear infinite;
}

@keyframes radar-sweep {
  to {
    transform: rotate(360deg);
  }
}

.radar-trail-1 {
  fill: currentColor;
  fill-opacity: 0.2;
}

.radar-trail-2 {
  fill: currentColor;
  fill-opacity: 0.12;
}

.radar-trail-3 {
  fill: currentColor;
  fill-opacity: 0.06;
}

.radar-lead {
  stroke: currentColor;
  stroke-opacity: 0.9;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.radar-blip {
  fill: currentColor;
  opacity: 0;
  animation: radar-blip 4s linear infinite;
  animation-delay: var(--delay, 0s);
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes radar-blip {
  0% {
    opacity: 1;
    transform: scale(1.8);
  }
  10% {
    opacity: 0.9;
    transform: scale(1.3);
  }
  40% {
    opacity: 0.4;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .radar-sweep {
    animation: none;
  }

  .radar-blip {
    animation: none;
    opacity: 0.8;
    transform: none;
  }
}

@media (prefers-color-scheme: dark) {
  #compass-radar {
    color: #6dbf8a;
  }

  .radar-bg {
    fill: rgba(255, 255, 255, 0.06);
  }
}

[data-theme='dark'] #compass-radar {
  color: #6dbf8a;
}

[data-theme='dark'] .radar-bg {
  fill: rgba(255, 255, 255, 0.06);
}

#nearest-distance {
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem 0 0.25rem;
}

#nearest-name {
  font-size: 1rem;
  color: var(--color-muted, #666);
  margin-bottom: 1.5rem;
}

#geo-status {
  color: var(--color-danger, #c0392b);
  min-height: 1.5rem;
  margin-bottom: 1rem;
}

#toilet-list {
  list-style: none;
  padding: 0 2em;
  max-width: 480px;
  margin: 0 auto;
}

#toilet-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border, #e0e0e0);
  text-align: left;
}

#enable-compass {
  display: none;
  margin-bottom: 1.5rem;
}
