﻿/* =============================================================================
 * ExoAtlas — Tonight's Sky page styles
 * ============================================================================= */

/* ── Light theme variables (matches site's white/black palette) ──────────── */
.tonight-page {
  --text:          #1f2937;
  --text-muted:    #6b7280;
  --surface:       #ffffff;
  --surface-hover: #f3f4f8;
  --border:        #e2e5ed;
  --accent:        #4a8fff;
  --bg:            #f5f6fb;

  color: var(--text);
  background: var(--bg);
}

/* HERO + LOCATION */
.tonight-hero {
  padding: clamp(2rem, 6vw, 4rem) 1rem 1.5rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.03) 0%, transparent 100%);

  text-align: center;
}
.tonight-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.tonight-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin: 0 0 2rem;
}
.tonight-hero-inner { max-width: 900px; margin: 0 auto; }

.location-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  text-align: left;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.location-summary {
  display: flex; align-items: center; gap: 1rem;
}
.location-icon {
  font-size: 1.75rem;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74, 143, 255, 0.1); border-radius: 12px;
  color: var(--accent);
}
.location-info { flex: 1; min-width: 0; }
.location-label { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.15rem; color: var(--text); }
.location-meta { font-size: 0.875rem; color: var(--text-muted); }
.location-edit-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.875rem; border-radius: 8px;
  font-size: 0.875rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.location-edit-btn:hover { background: var(--surface-hover); border-color: #bbb; }

.location-form {
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.loc-search-row {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.loc-search-row input[type="text"] {
  flex: 1 1 200px; min-width: 0;
  padding: 0.6rem 0.85rem;
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.loc-results {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; max-height: 240px; overflow-y: auto;
  margin-bottom: 0.75rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.loc-results-item {
  padding: 0.65rem 0.85rem; cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem; color: var(--text);
}
.loc-results-item:hover { background: var(--surface-hover); }
.loc-results-item:last-child { border-bottom: none; }
.loc-results-item-meta { font-size: 0.8rem; opacity: 0.65; margin-top: 0.15rem; }
.loc-results-empty { padding: 0.75rem; opacity: 0.7; font-size: 0.9rem; }

.loc-coord-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.loc-coord-row label { font-size: 0.85rem; opacity: 0.85; display: flex; flex-direction: column; gap: 0.3rem; }
.loc-coord-row input, .loc-coord-row select {
  padding: 0.5rem 0.7rem;
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.95rem; font-family: inherit;
}
.loc-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.loc-save-msg { font-size: 0.875rem; opacity: 0.85; }
.loc-save-msg.error { color: #ff8a8a; }
.loc-save-msg.success { color: #7fdf95; }
.loc-signin-hint {
  font-size: 0.85rem; opacity: 0.7; margin: 0.75rem 0 0;
}
.loc-signin-hint a { color: inherit; text-decoration: underline; }

.btn-primary, .btn-secondary, .btn-tertiary {
  font-family: inherit; font-size: 0.9rem;
  padding: 0.55rem 1rem; border-radius: 8px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.btn-primary { background: #4a8fff; color: #fff; border: 1px solid #4a8fff; }
.btn-primary:hover { background: #3a7fee; }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-tertiary { background: transparent; color: var(--text); border: 1px solid transparent; }
.btn-tertiary:hover { background: var(--surface-hover); }

/* VERDICT */
.verdict-section { padding: 0 1rem; max-width: 1200px; margin: 0 auto 2rem; }
.verdict-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  /* Left accent bar (color set by JS via --verdict-accent) */
  border-left: 4px solid var(--verdict-accent, #4a8fff);
  border-radius: 14px; padding: 1.25rem 1.5rem;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.verdict-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--verdict-accent, #4a8fff) 0%, transparent 35%);
  opacity: 0.18; pointer-events: none;
}
.verdict-score-num {
  font-size: 3rem; font-weight: 700; line-height: 1;
  color: var(--verdict-accent, #4a8fff);
}
.verdict-score-label { font-size: 0.85rem; color: var(--text-muted); }
.verdict-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text); }
.verdict-sub { font-size: 0.95rem; color: var(--text-muted); }
.verdict-quick { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.88rem; }
.vq { color: var(--text-muted); }
.vq i { width: 1.25rem; text-align: center; color: var(--accent); opacity: 1; }
@media (max-width: 720px) {
  .verdict-card { grid-template-columns: auto 1fr; }
  .verdict-quick { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 1rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
}

/* GRID */
.tonight-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr); gap: 1.25rem;
  max-width: 1280px; margin: 0 auto 2rem; padding: 0 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 1.25rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem;
}
.card-head h2 {
  font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 0.5rem;
  color: var(--text);
}
.card-head h2 i { color: var(--accent); }
.card-sub { font-size: 0.82rem; color: var(--text-muted); }
.card-foot { font-size: 0.76rem; color: var(--text-muted); margin: 0.75rem 0 0; border-top: 1px solid var(--border); padding-top: 0.6rem; }

.card-planets    { grid-column: span 12; }
.card-altitude   { grid-column: span 12; }
.card-moon       { grid-column: span 4; align-self: start; }
.card-weather    { grid-column: span 4; }
.card-conjunctions { grid-column: span 4; }
.card-targets    { grid-column: span 12; }
@media (max-width: 960px) {
  .card-altitude, .card-weather, .card-conjunctions { grid-column: span 12; }
  /* Moon stays at 4 columns down to ~640px, then goes full width */
}
@media (max-width: 640px) {
  .card-moon { grid-column: span 12; }
}

/* Planet table */
.planet-table-wrap { overflow-x: auto; }
.planet-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.planet-table th, .planet-table td {
  padding: 0.6rem 0.5rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.planet-table th { font-weight: 600; color: var(--text-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.planet-table td { color: var(--text); }
.planet-table td:first-child { font-weight: 600; }
.body-symbol { display: inline-block; width: 1.5em; text-align: center; opacity: 0.85; }
.dim-row { opacity: 0.45; }
.below-horizon { font-style: italic; opacity: 0.6; }

/* Altitude chart */
.alt-chart-wrap { width: 100%; position: relative; }
/* 900×240 viewBox → at 1200px rendered width, height ≈ 320px — good for full-width card */
#altChart { width: 100%; height: auto; display: block; cursor: crosshair; max-height: 380px; }
.alt-grid { stroke: rgba(0,0,0,0.07); stroke-width: 1; fill: none; }
.alt-axis { stroke: rgba(0,0,0,0.2); stroke-width: 1; }
.alt-axis-label { fill: #6b7280; font-size: 11px; font-family: 'Poppins', sans-serif; }
.alt-twilight { fill: rgba(10, 20, 100, 0.06); }
.alt-curve { fill: none; stroke-width: 2.5; transition: opacity 0.15s; }
.alt-curve-hidden { opacity: 0 !important; pointer-events: none; }
/* Vertical time-cursor line — dashed, accent blue so it reads clearly */
.alt-crosshair {
  stroke: rgba(74,143,255,0.75);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  fill: none;
  pointer-events: none;
  visibility: hidden;
}
.alt-crosshair.is-visible { visibility: visible; }
.alt-tooltip {
  position: absolute;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 10;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.alt-tip-time { font-weight: 600; color: var(--accent); margin-bottom: 0.15rem; }
.alt-tip-body { display: flex; align-items: center; gap: 0.4rem; color: var(--text); }
.alt-tip-swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; }
.legend-btn { display: flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.5rem;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface-hover);
  color: var(--text); font: inherit; font-size: 0.8rem; cursor: pointer;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s; }
.legend-btn:hover { background: #e8eaf0; }
.legend-btn.is-off { opacity: 0.4; background: transparent; }
.legend-swatch { width: 14px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* Moon */
.moon-display { display: flex; gap: 1rem; align-items: center; }
#moonSvg { width: 80px; height: 80px; flex-shrink: 0; }
.moon-stats { margin: 0; display: grid; gap: 0.5rem; flex: 1; }
.moon-stats div { display: flex; justify-content: space-between; font-size: 0.9rem; gap: 1rem; }
.moon-stats dt { color: var(--text-muted); }
.moon-stats dd { margin: 0; font-weight: 500; color: var(--text); }

/* Weather */
.weather-now { font-size: 0.95rem; }
.weather-summary { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.weather-temp { font-size: 2rem; font-weight: 600; }
.weather-icon { font-size: 1.75rem; opacity: 0.85; }
.weather-meta { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.weather-hourly {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem; margin-top: 0.5rem; font-size: 0.72rem;
}
.weather-hour {
  text-align: center; padding: 0.4rem 0.15rem;
  background: var(--surface-hover); border-radius: 6px;
}
.weather-hour-label { opacity: 0.7; margin-bottom: 0.15rem; }
.weather-hour-cloud {
  height: 4px; background: linear-gradient(90deg, #4a8fff 0%, #cccccc 100%);
  border-radius: 2px; margin: 0.25rem 0; opacity: var(--cloud-opacity, 0.5);
}
.weather-hour-temp { font-weight: 500; }
.weather-error { color: #ff8a8a; font-size: 0.85rem; opacity: 0.85; }

/* Conjunctions */
.conj-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.conj-item {
  display: grid; grid-template-columns: 1fr auto;
  gap: 0.75rem; align-items: center;
  padding: 0.7rem 0.85rem;
  background: var(--surface); border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid #ffb84a;
}
.conj-pair { font-weight: 600; color: var(--text); }
.conj-when { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; }
.conj-sep { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 0.9rem; }
.conj-empty { color: var(--text-muted); font-style: italic; padding: 1rem 0.5rem; text-align: center; }

/* Targets */
.target-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.target-item {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s;
}
.target-item:hover { background: var(--surface-hover); }
.target-symbol { font-size: 1.5rem; opacity: 0.85; min-width: 1.5em; text-align: center; }
.target-name { font-weight: 600; color: var(--text); }
.target-meta { font-size: 0.78rem; color: var(--text-muted); }
.target-rating { margin-left: auto; font-weight: 600; font-size: 0.85rem; padding: 0.15rem 0.5rem; border-radius: 4px; }
.target-rating.good { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.target-rating.ok   { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.target-rating.poor { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

/* PRO */
.pro-section { padding: 1rem; max-width: 1280px; margin: 0 auto 2.5rem; }
.pro-section-inner { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.pro-section-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.pro-section-head h2 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem; }
.pro-section-head h2 i { color: #ffb84a; }
.pro-badge {
  background: linear-gradient(90deg, #ffb84a, #ff8a4a); color: #1a1100;
  padding: 0.15rem 0.6rem; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
}
.pro-upsell-content h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.pro-upsell-content p { opacity: 0.85; line-height: 1.55; }
.pro-feature-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.4rem; }
.pro-feature-list i { color: #7fdf95; margin-right: 0.4rem; }
.forecast-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.forecast-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 0.25rem; }
@media (max-width: 720px) { .forecast-strip { grid-template-columns: repeat(7, 1fr); } }
.forecast-night {
  background: var(--surface-hover); border-radius: 6px;
  padding: 0.5rem 0.25rem; text-align: center; cursor: default;
  border-top: 4px solid var(--night-color, #4a8fff);
  font-size: 0.72rem;
}
.forecast-night-day { font-weight: 600; }
.forecast-night-score { font-size: 1.25rem; font-weight: 600; margin: 0.25rem 0; line-height: 1; }
.forecast-night-meta { opacity: 0.7; font-size: 0.66rem; }

/* METHODOLOGY */
.methodology { max-width: 1280px; margin: 0 auto 3rem; padding: 0 1rem; }
.methodology details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.75rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.methodology summary { cursor: pointer; font-weight: 500; color: var(--text); }
.methodology summary i { margin-right: 0.4rem; color: var(--accent); }
.methodology-body { padding-top: 0.75rem; color: var(--text-muted); line-height: 1.55; font-size: 0.9rem; }
.methodology-body ul { padding-left: 1.25rem; }
.methodology-body a { color: #4a8fff; }

/* BORTLE AUTO-DETECT HINT */
.loc-bortle-auto {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.8;
  line-height: 1.3;
}
.loc-bortle-auto i { margin-right: 0.3rem; opacity: 0.85; }
.loc-bortle-auto strong { font-weight: 600; }
.loc-bortle-auto.overridden { color: #ffd27a; opacity: 0.95; }
.loc-bortle-auto.error { color: #ff8a8a; }
.btn-link {
  background: none; border: none; color: #4a8fff; cursor: pointer;
  font: inherit; font-size: 0.78rem; padding: 0.15rem 0;
  margin-top: 0.2rem; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.btn-link:hover { text-decoration: underline; }

/* LIGHT POLLUTION MAP */
.lp-section {
  max-width: 1280px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}
.lp-section-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.lp-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.lp-head h2 {
  margin: 0; font-size: 1.15rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.45rem;
}
.lp-head h2 i { color: var(--accent); }
.lp-head .card-sub { font-size: 0.8rem; opacity: 0.7; }

.lp-legend {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; opacity: 0.75; margin: 0.25rem 0 0.6rem;
}
.lp-legend-bar {
  flex: 1; height: 8px; border-radius: 4px;
  /* DJ Lorenz palette progression: black → gray → blue → green → yellow →
     orange → red → magenta → white. Matches what's painted on the map. */
  background: linear-gradient(90deg,
    #000000 0%, #373750 8%, #0000dc 18%, #006ec8 28%,
    #00c800 40%, #ffe600 55%, #ffa500 68%, #ff0000 80%,
    #ff3cdc 90%, #ffffff 100%);
  border: 1px solid var(--border);
}
.lp-legend-label { white-space: nowrap; }

.lp-map {
  width: 100%;
  height: clamp(260px, 45vh, 480px);
  border-radius: 10px;
  overflow: hidden;
  background: #e7eaf2;
  border: 1px solid var(--border);
}

/* Light theme: show OSM at natural brightness */
.lp-basemap { filter: none; }
.lp-lights   { filter: contrast(1.05) saturate(1.1) brightness(1.05); }

.leaflet-container {
  background: #e7eaf2;
  font-family: inherit;
}
.leaflet-control-attribution {
  background: rgba(255,255,255,0.9) !important;
  color: #444 !important;
  font-size: 0.7rem !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-bar a {
  background: #fff !important;
  color: #222 !important;
  border-bottom-color: var(--border) !important;
}
.leaflet-bar a:hover { background: var(--surface-hover) !important; }
