/* ===== WEATHER DIAL — style.css ===== */

body {
  margin: 0;
  background:
    radial-gradient(
      circle at center,
      rgba(61, 91, 160, 0.7) 0%,
      rgba(5, 14, 41, 0.91) 34%,
      rgba(1, 1, 10, 1) 100%
    );
  overflow: hidden;
  min-height: 100vh;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

#dial-wrapper {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-block;
  z-index: 5;
}

canvas {
  display: block;
  width: min(100vmin, calc(100vh - 140px), 100vw);
  height: min(100vmin, calc(100vh - 140px), 100vw);
  touch-action: none;
}

#top-info-stack {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 3.4px 33.4px 0 3.4px;
  box-sizing: border-box;
  width: 100%;
  pointer-events: none;
}

#location-info {
  position: static;
  z-index: 20;
  color: rgba(255, 255, 255, 0.93);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.72);
  font-size: 14px;
  line-height: 1.04;
  padding: 3.4px;
  padding-left: 3.4px;
  background-image: radial-gradient(
    circle at right,
    rgba(5, 14, 41, 0.7) 0%,
    rgba(61, 91, 160, 0.7) 50%,
    rgba(100, 100, 160, 0.7) 100%
  );
  letter-spacing: 0.01em;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  width: fit-content;
  max-width: calc(100vw - 20px);
}

#location-info .location-line {
  white-space: nowrap;
}

#location-divider {
  position: static;
  width: calc(100vw - 20px);
  height: 1.4px;
  background: linear-gradient(to right, rgba(221, 221, 255, 0.91) 0%, rgba(140, 140, 250, 0.14) 91%);
  z-index: 19;
  pointer-events: none;
  margin: 0;
}

#solar-info {
  position: static;
  z-index: 20;
  padding: 3.4px;
  padding-left: 3.4px;
  background-image: radial-gradient(
    circle at right,
    rgba(5, 14, 41, 0.7) 0%,
    rgba(61, 91, 160, 0.7) 50%,
    rgba(100, 100, 160, 0.7) 100%
  );
  color: rgba(255, 255, 255, 0.93);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.72);
  font-size: 14px;
  line-height: 1.04;
  letter-spacing: 0.01em;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  max-width: calc(100vw - 20px);
  width: fit-content;
}

#solar-info .solar-line {
  margin: 0;
}

#mode-stack {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.4px;
  width: max-content;
  max-width: calc(100vw - 18px);
}

.mode-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.4px;
  padding: 3.4px;
  background: linear-gradient(to right, rgba(5, 5, 55, 0.77) 0%, rgba(255, 255, 255, 0.14) 50%, rgba(5, 5, 55, 0.77) 100%);
  user-select: none;
  -webkit-user-select: none;
  width: max-content;
}

#mode-panel .mode-row,
#mode-sub-panel .mode-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

#mode-panel button,
#mode-sub-panel button {
  appearance: none;
  border: 0;
  border-radius: 2.3px;
  padding: 3.4px 3.4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.97);
  font: 600 13.1px/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

#mode-panel button:active,
#mode-sub-panel button:active {
  transform: scale(0.82);
}

#mode-panel button.active,
#mode-sub-panel button.active {
  color: rgba(0, 0, 55, 0.91);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.77) 34%, rgba(95, 95, 145, 0.77));
}

#mode-panel button.subtle,
#mode-sub-panel button.subtle {
  font-size: 13.1px;
  padding: 3.4px 3.4px;
  color: rgba(255, 255, 255, 0.82);
}

#mode-panel button.subtle.active,
#mode-sub-panel button.subtle.active {
  color: rgba(0, 0, 55, 0.91);
  background: linear-gradient(to top, rgba(95, 95, 145, 0.77), rgba(255, 255, 255, 0.77));
}

.source-toggle {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  letter-spacing: 0.02em;
  user-select: none;
  -webkit-user-select: none;
}

.source-toggle .source-label {
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
  opacity: 0.7;
}

.source-toggle .source-label.active {
  opacity: 1;
  color: rgba(255, 255, 255, 0.95);
}

.source-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 19px;
}

.source-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.source-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.source-slider:before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 1px;
  top: 2px;
  background: rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  transition: transform 0.34s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.source-switch input:checked + .source-slider {
  background: rgba(0, 0, 115, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
}

.source-switch input:checked + .source-slider:before {
  transform: translateX(16px);
}

#info-divider {
  position: static;
  width: calc(100vw - 20px);
  height: 1.4px;
  background: linear-gradient(to right, rgba(221, 221, 255, 0.91) 0%, rgba(140, 140, 250, 0.14) 91%);
  z-index: 19;
  pointer-events: none;
  margin: 0;
}

#date-weather-info {
  position: static;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3.4px;
  padding-left: 5px;
  color: rgba(255, 255, 255, 0.93);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
  font-size: 19px;
  line-height: 1.04;
  background-image: radial-gradient(circle at right, rgba(5, 14, 41, 0.7) 0%, rgba(61, 91, 160, 0.7) 50%, rgba(100, 100, 160, 0.7) 100%);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  width: fit-content;
  max-width: calc(100vw - 20px);
}

#weather-icon {
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
}

#tide-divider {
  position: static;
  width: calc(100vw - 20px);
  height: 1.4px;
  background: linear-gradient(to right, rgba(221, 221, 255, 0.91) 0%, rgba(140, 140, 250, 0.14) 91%);
  z-index: 19;
  pointer-events: none;
  margin: 0;
}

#tide-info {
  position: static;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 3.4px;
  padding-left: 5px;
  color: rgba(255, 255, 255, 0.93);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.64);
  font-size: 13.1px;
  line-height: 1.04;
  background-image: radial-gradient(circle at right, rgba(5, 14, 41, 0.7) 0%, rgba(61, 91, 160, 0.7) 50%, rgba(100, 100, 160, 0.7) 100%);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  width: fit-content;
  max-width: calc(100vw - 20px);
}

#tide-info .tide-line {
  margin: 0;
  white-space: nowrap;
}


/* ===== TIDE LOCATION ROW ===== */
.tide-location-row {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.tide-location-btn {
  font-size: 11px !important;
  letter-spacing: 0.03em !important;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== WIND ANALYSIS SUITE v1 ===== */
:root {
  --gust-halo-max: 24;
  --gust-pulse-speed: 1.8;
  --gradient-low: #3b82f6;
  --gradient-mid: #22c55e;
  --gradient-high: #ef4444;
}

#wind-analysis-panel {
  position: fixed;
  right: 8px;
  top: 110px;
  width: 220px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: white;
  z-index: 60;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.wind-gradient-bar {
  height: 8px;
  border-radius: 4px;
  margin: 2px 0;
  background: linear-gradient(90deg, var(--gradient-low), var(--gradient-mid), var(--gradient-high));
}

/* ===== MENU ICON + DROPDOWN ===== */

/* Anchor container — fixed top-right, 10 px from each edge */
#menu-anchor {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Menu trigger button — 34×34 px circular canvas */
#menu-btn {
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

#menu-btn:hover  { opacity: 0.84; }
#menu-btn:active { opacity: 0.62; transform: scale(0.90); }

#menu-icon-canvas {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  pointer-events: none;
}

/* Dropdown panel — slides down on .open, centred under menu button */
#menu-dropdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  background: transparent;
  border: none;

  /* Collapsed state */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scaleY(0.85);
  transform-origin: top center;
  transition:
    max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity    0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform  0.30s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-dropdown.open {
  max-height: 260px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scaleY(1);
}

/* Individual sub-menu item buttons — 34×34 px circular canvas, same styling as menu icon */
.menu-item {
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.menu-item:hover  { opacity: 0.84; }
.menu-item:active { opacity: 0.60; transform: scale(0.90); }

.menu-item-canvas {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  pointer-events: none;
}
