/* ============================================================
   PAGE: SPOTS
   Styles for the spots index, show, new, and edit pages.
   ============================================================ */

/* ---- Page header banner. Pages inside an .atmosphere wrapper override
   the background via pages/spot_form.css so it merges into the sky. ---- */
.spot-header {
  background: var(--gradient-hero);
  padding: 5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.spot-header .star {
  background: rgba(255,255,255,0.7);
}

.spot-header-icon {
  font-size: 2.75rem;
  animation: float 4s ease-in-out infinite;
  display: block;
  margin-bottom: 0.85rem;
}

.spot-header h1 {
  margin: 0 0 0.4rem;
  color: var(--color-white);
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.spot-header p {
  margin: 0;
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
}

/* ---- Main content containers ---- */
.spot-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.spots-body {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ============================================================
   SHOW PAGE — pilot's console
   ============================================================ */
.spot-show-hero {
  text-align: center;
  padding: 4.5rem 1.5rem 2rem;
}

.spot-show-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  margin-bottom: 1.25rem;
}

.spot-show-title {
  margin: 0 0 0.6rem;
  color: var(--color-white);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  line-height: 1.05;
}

.spot-show-sub {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
}

.spot-show-coords {
  display: inline-flex;
  gap: 0.5rem;
}

.coord-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  backdrop-filter: blur(10px);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.coord-chip-label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}

.spot-show-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spot-show-section-title {
  margin: 0 0 0.95rem;
  color: var(--color-white);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.spot-show-section {
  margin-top: 0.5rem;
}

/* ---- Instrument stack — each condition's summary becomes a console panel ---- */
.instrument-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.instrument {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(8px);
}

.instrument-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.instrument-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.16), rgba(255, 217, 61, 0.16));
  font-size: 1.4rem;
  flex-shrink: 0;
}

.instrument--wind .instrument-icon {
  background: linear-gradient(135deg, rgba(75, 63, 160, 0.16), rgba(78, 205, 196, 0.16));
}

.instrument--direction .instrument-icon {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.18), rgba(255, 217, 61, 0.18));
}

.instrument-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.instrument-readout {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-dark);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.instrument-readout--empty {
  font-weight: 700;
  color: var(--color-gray-400);
  font-style: italic;
}

.instrument-body {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.instrument--temperature .instrument-body {
  align-self: stretch;
  padding: 0.25rem 0;
}

.instrument--wind .instrument-body {
  flex: 0 0 180px;
  align-self: stretch;
}

.instrument--wind .wind-viz {
  width: 100%;
  height: 90px;
}

.instrument--direction .instrument-body {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

/* ---- Direction rose (mini compass for summary) ---- */
.dir-rose {
  --needle-angle: 0deg;
  position: relative;
  width: 96px;
  height: 96px;
}

.dir-rose svg {
  width: 100%;
  height: 100%;
}

.dir-rose__needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 38px;
  margin-top: -32px;
  margin-left: -1.5px;
  transform-origin: 50% calc(100% - 6px);
  transform: rotate(var(--needle-angle));
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-end) 100%);
  border-radius: var(--radius-full);
  filter: drop-shadow(0 1px 4px rgba(255, 107, 53, 0.5));
}

.dir-rose__needle::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-white);
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* The rose is 96px against 220px for the picker, and its streaks sit over the
   SVG face rather than behind buttons — so scale them down and soften. */
.dir-rose .compass-wind {
  --streak-peak: 0.55;
}

.dir-rose .compass-wind__streak {
  height: 1.5px;
}

/* ---- Mini map (read-only Leaflet preview on the show page) ---- */
.mini-map {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-panel-lg);
  background: var(--color-dark);
  position: relative;
}

.mini-map__leaflet {
  height: 280px;
  width: 100%;
}

.mini-map__leaflet .leaflet-container {
  height: 100%;
  width: 100%;
  font-family: var(--font-family);
}

.mini-map__caption {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  background: rgba(10, 14, 50, 0.92);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.mini-map__caption strong {
  color: var(--color-primary-end);
  font-weight: 900;
}

.mini-map__caption-icon {
  font-size: 1.15rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Custom marker (HTML divIcon) — a glowing balloon pin */
.static-map-marker__pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 48px;
  font-size: 2rem;
  filter: drop-shadow(0 4px 10px rgba(255, 107, 53, 0.55));
  animation: float 4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .static-map-marker__pin { animation: none; }
}

/* ---- Show page action bar (on dark sky) ---- */
.spot-show-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
}

.spot-show-actions .btn-danger {
  background: rgba(220, 38, 38, 0.18);
  color: #ffb4b4;
  border: 1px solid rgba(220, 38, 38, 0.4);
}

.spot-show-actions .btn-danger:hover {
  background: rgba(220, 38, 38, 0.32);
  color: #fff;
}

/* ---- Direction pills inside the instrument ---- */
.instrument .winddir-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  max-width: 160px;
}

.instrument .winddir-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
}

/* ============================================================
   INDEX PAGE
   ============================================================ */
.spots-page-head {
  text-align: center;
  padding: 4.5rem 1.5rem 2rem;
}

.spots-page-head h1 {
  margin: 0 0 0.5rem;
  color: var(--color-white);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.4);
}

.spots-page-head p {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.1rem;
}

/* Subscribed state gets the same teal ring the tab bar uses for
   "something active here" */
.push-toggle[data-state="subscribed"] {
  box-shadow: 0 0 0 2px var(--color-accent), var(--shadow-btn-secondary);
}

.push-toggle[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- The grid ---- */
.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.spot-card {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-2xl);
  padding: 1.5rem 1.4rem 1.3rem;
  box-shadow: var(--shadow-panel);
  transition:
    transform var(--dur-hover) var(--ease-out-soft),
    box-shadow var(--dur-hover) var(--ease-out-soft);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  isolation: isolate;
}

.spot-card::before {
  content: '🎈';
  position: absolute;
  right: -1.25rem;
  bottom: -2rem;
  font-size: 8rem;
  opacity: 0.06;
  z-index: -1;
  pointer-events: none;
  filter: grayscale(0.2);
}

.spot-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-panel-lg);
}

@media (prefers-reduced-motion: reduce) {
  .spot-card { transition: none; }
  .spot-card:hover { transform: none; }
}

.spot-card-pin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-gray-500);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: flex-start;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.spot-card-name {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--color-dark);
  line-height: 1.1;
  margin: 0;
}

.spot-card-arrow {
  color: var(--color-primary);
  font-weight: 800;
  font-size: 0.92rem;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: -0.01em;
}

.spot-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.spot-card-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--gradient-primary);
  color: var(--color-dark);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

/* ---- "Launch new" card ---- */
.spot-card--new {
  background: linear-gradient(160deg, rgba(255, 217, 61, 0.16) 0%, rgba(255, 107, 53, 0.18) 100%);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  color: var(--color-white);
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 160px;
  padding: 1.5rem;
}

.spot-card--new::before {
  display: none;
}

.spot-card--new:hover {
  background: linear-gradient(160deg, rgba(255, 217, 61, 0.28) 0%, rgba(255, 107, 53, 0.32) 100%);
  border-color: rgba(255, 255, 255, 0.65);
}

.spot-card-new-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  animation: float 4s ease-in-out infinite;
}

.spot-card-new-label {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-white);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  margin: 0;
}

/* ---- Empty state ---- */
.spots-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
}

.spots-empty .empty-balloon {
  position: relative;
  display: inline-block;
  width: clamp(140px, 22vw, 220px);
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.5));
  animation: empty-ascend 6s ease-in-out infinite;
}

.empty-balloon__svg {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes empty-ascend {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-22px) rotate(2deg); }
}

.spots-empty h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--color-white);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.spots-empty p {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.72);
}

/* ============================================================
   FORECAST PAGE — the week ahead on sky strips. A session of
   matching hours is a lit slice on its day's strip: the same
   instrument you set the window with, now reading the answer.
   ============================================================ */

/* Glass banner naming what the balloon is watching for */
.forecast-watching {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
}

.forecast-watching__label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-right: 0.35rem;
}

/* The week panel — same recipe as a show-page instrument */
.forecast-week {
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-xl);
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(8px);
}

.forecast-week__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 1.1rem;
}

.forecast-week__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.forecast-week__summary {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-gray-500);
}

.forecast-week__summary strong {
  color: var(--color-dark);
  font-weight: 900;
}

/* On the forecast the strips are an answer, not an input, so the contrast
   turns way up: hours without a session are near-black, days without one
   fade back entirely, and each session is an explicit glowing slice. */
.forecast-week .sky-strip::before,
.forecast-week .sky-strip::after {
  background: rgba(4, 9, 34, 0.92);
}

.forecast-week .sky-day--off .sky-strip {
  opacity: 0.45;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.forecast-week .sky-day--session .sky-day__label,
.forecast-week .sky-day--session .sky-day__readout {
  color: var(--color-dark);
}

/* Interior shroud: dims the gap between two sessions on the same day.
   The strip's own ::before/::after shrouds handle the outer darkness. */
.sky-strip__shroud {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(4, 9, 34, 0.92);
  pointer-events: none;
  z-index: 1;
}

/* The session itself: a lit slice with a bright rim and a golden glow */
.sky-strip__session {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 14px rgba(247, 201, 75, 0.65);
  pointer-events: none;
  z-index: 2;
}

/* Session chips under a day's strip */
.sky-day__sessions {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: -0.1rem 0 0.4rem;
}

/* Session chips speak the app's "value chip" language: warm gradient,
   dark text — a match, not a disabled gray tag. */
.session-run {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-dark);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  animation: panel-in var(--dur-move) var(--ease-out-soft);
}

.session-run__conditions {
  color: rgba(26, 26, 46, 0.72);
  font-weight: 700;
}

.forecast-week__empty {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-gray-400);
}

.stale-notice {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.18), rgba(255, 107, 53, 0.18));
  border: 1px solid rgba(255, 107, 53, 0.25);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-card);
}

.stale-notice-icon { font-size: 2rem; flex-shrink: 0; animation: float 4s ease-in-out infinite; }
.stale-notice-text { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.9rem; line-height: 1.4; }
.stale-notice-text strong { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--color-white); }

.action-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .instrument {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .instrument-body { justify-content: flex-start; }
  .instrument--wind .instrument-body { flex: 0 0 auto; }
  .instrument--direction .instrument-body { align-items: flex-start; }
  .instrument .winddir-pills { justify-content: flex-start; max-width: none; }
}
