/* ── StarGazer Dashboard — Deep Space Theme ─────────────────────────────── */

:root {
  --bg-void: #050510;
  --bg-deep: #08091a;
  --bg-card: rgba(12, 14, 35, 0.85);
  --bg-card-hover: rgba(18, 22, 50, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border: rgba(100, 120, 220, 0.15);
  --border-glow: rgba(120, 160, 255, 0.35);

  --accent-blue: #4a9eff;
  --accent-purple: #a855f7;
  --accent-gold: #f59e0b;
  --accent-teal: #14b8a6;
  --accent-red: #ef4444;
  --accent-green: #22c55e;
  --accent-orange: #f97316;
  --accent-scorpius: #ff6b35;

  --text-primary: #e8ecff;
  --text-secondary: #8892b0;
  --text-muted: #4a5568;
  --text-accent: #a0c4ff;

  --font-main: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 4px 40px rgba(0, 0, 50, 0.6), 0 1px 0 rgba(100, 140, 255, 0.1) inset;
  --glow-blue: 0 0 30px rgba(74, 158, 255, 0.15);
  --glow-scorpius: 0 0 30px rgba(255, 107, 53, 0.12);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Starfield Canvas ──────────────────────────────────────────────────── */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.header, .main, .footer { position: relative; z-index: 1; }

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  background: rgba(5, 5, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(74, 158, 255, 0.5));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.logo-main {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.logo-slogan {
  font-size: 0.75rem;
  color: var(--accent-blue);
  opacity: 0.8;
  margin-top: 2px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.logo-slogan:hover {
  opacity: 1;
  text-decoration: underline;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-green);
}

.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.clock {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-blue);
  letter-spacing: 0.05em;
}

.date-display {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Go/No-Go Banner ───────────────────────────────────────────────────── */
.gonogo-banner {
  border-radius: var(--radius);
  padding: 20px 28px;
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  transition: all 0.5s ease;
  margin-top: 24px;
}

.gonogo-banner.go {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.08);
}

.gonogo-banner.marginal {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

.gonogo-banner.nogo {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

.gonogo-banner.loading-state {
  background: rgba(74, 158, 255, 0.05);
  border-color: var(--border);
}

.gonogo-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.gonogo-icon { font-size: 2.4rem; }

.gonogo-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.gonogo-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.gonogo-detail {
  margin-left: auto;
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), var(--glow-blue);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.lang-select {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9em;
  margin-right: 10px;
  cursor: pointer;
  outline: none;
}
.lang-select:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.card-icon { font-size: 1.4rem; }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  flex: 1;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(74, 158, 255, 0.15);
  border: 1px solid rgba(74, 158, 255, 0.3);
  color: var(--accent-blue);
  white-space: nowrap;
}

.card-body {
  padding: 20px 24px;
}

.ext-link {
  font-size: 0.78rem;
  color: var(--accent-blue);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.ext-link:hover { opacity: 1; }

/* ── Card Row ───────────────────────────────────────────────────────────── */
.card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card-row-2 {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 1100px) {
  .card-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .card-row, .card-row-2 { grid-template-columns: 1fr; }
}

/* ── Seeing Card ────────────────────────────────────────────────────────── */
.metric-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.metric {
  flex: 1;
  text-align: center;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  border: 1px solid var(--border);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.seeing-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.dark-window {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ── Moon Card ──────────────────────────────────────────────────────────── */
.moon-phase-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.moon-arc-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.moon-arc-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.moon-arc-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f59e0b, #fde68a);
  transition: width 1s ease;
}

.moon-arc-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-gold);
  min-width: 32px;
}

.moon-times {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.ti-label {
  color: var(--text-muted);
  margin-right: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dso-impact {
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
}

/* ── Scorpius Card ──────────────────────────────────────────────────────── */
.card-scorpius:hover {
  box-shadow: var(--shadow-card), var(--glow-scorpius);
  border-color: rgba(255, 107, 53, 0.3);
}

.scorpius-status, .ac-status {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.4;
  padding: 10px 14px;
  background: var(--bg-glass);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.ac-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}

.ac-select-wrap::after {
  content: '▼';
  font-size: 0.6rem;
  color: var(--text-muted);
  position: absolute;
  right: 12px;
  pointer-events: none;
}

.ac-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 6px 30px 6px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.ac-select:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.ac-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.ac-select option {
  background: var(--bg-card);
  color: #fff;
  font-family: var(--font-sans);
}


.scorpius-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.sg-item {
  background: var(--bg-glass);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
}

.sg-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.sg-item span:last-child {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-scorpius);
}

.scorpius-tip {
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent-scorpius);
  padding-left: 10px;
  line-height: 1.5;
}

/* ── Planet List ────────────────────────────────────────────────────────── */
.planet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.planet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.planet-item:hover {
  background: rgba(74, 158, 255, 0.06);
  border-color: rgba(74, 158, 255, 0.2);
}

.planet-item.not-visible {
  opacity: 0.45;
}

.planet-emoji { font-size: 1.3rem; }

.planet-name {
  font-weight: 600;
  font-size: 0.92rem;
  flex: 1;
}

.planet-alt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-blue);
}

.planet-dir {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 35px;
  text-align: right;
}

.planet-vis-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.planet-vis-dot.visible { background: var(--accent-green); }
.planet-vis-dot.hidden { background: var(--text-muted); }

/* ── Must-See Alerts ────────────────────────────────────────────────────── */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.18);
  font-size: 0.88rem;
  line-height: 1.5;
  animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Weather Embed ──────────────────────────────────────────────────────── */
.weather-embed-wrap {
  background: transparent;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#clearoutside-img {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

/* Location UI */
.location-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.location-btn:hover { opacity: 1; }

.modal {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.modal-content h2 { margin-top: 0; font-size: 1.2rem; }
.modal-content p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.4; }
.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 5px; font-size: 0.85rem; color: var(--text-dim); }
.input-group input { 
  width: 100%; 
  padding: 10px; 
  background: rgba(255,255,255,0.05); 
  border: 1px solid var(--border-color); 
  color: var(--text-light); 
  border-radius: 6px; 
}
.btn {
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: rgba(255,255,255,0.1); color: white; }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.modal-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: all 0.2s;
}
.modal-btn:hover { background: rgba(255, 255, 255, 0.1); }
.modal-btn.primary {
  background: var(--accent-blue);
  color: #fff;
  border-color: transparent;
}
.modal-btn.primary:hover { background: #3a8ded; }

.modal-close {
  display: block;
  margin: 30px auto 0;
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.location-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.loc-item {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.2s;
}
.loc-item:hover { background: rgba(255,255,255,0.06); }
.loc-item.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}
.loc-info {
  flex: 1;
  cursor: pointer;
}
.loc-name { font-weight: 600; font-size: 0.95rem; }
.loc-coords { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; font-family: var(--font-mono); }
.loc-del {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  padding: 4px 8px;
}
.loc-del:hover { opacity: 1; }

/* ── Target Database ────────────────────────────────────────────────────── */

.constellation-tabs {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  -ms-overflow-style: auto;
  white-space: nowrap;
}
/* Force persistent scrollbar in WebKit (Chrome/Safari) */
.constellation-tabs::-webkit-scrollbar {
  height: 8px;
  -webkit-appearance: none;
}
.constellation-tabs::-webkit-scrollbar-track {
  background: var(--card-bg);
  border-radius: 4px;
}
.constellation-tabs::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.4);
  border-radius: 4px;
}
.constellation-tabs::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.8);
}
.const-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.const-tab:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.const-tab.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: white;
}

.targets-scope-note {
  padding: 12px 24px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

.filter-row {
  display: flex;
  gap: 6px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(74, 158, 255, 0.1);
  border-color: rgba(74, 158, 255, 0.3);
  color: var(--accent-blue);
}

.filter-btn.active {
  background: rgba(74, 158, 255, 0.15);
  border-color: rgba(74, 158, 255, 0.5);
  color: var(--accent-blue);
  font-weight: 600;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}

.target-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: all 0.25s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.target-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.target-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: 0 8px 30px rgba(0, 0, 50, 0.4);
}

.target-card:hover::before { opacity: 1; }

.target-card.visible-now {
  border-color: rgba(34, 197, 94, 0.3);
}

.target-card.visible-now::before {
  background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
  opacity: 1;
}

.tc-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.tc-emoji { font-size: 1.5rem; }

.tc-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  flex: 1;
}

.tc-type {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.tc-mag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
  align-self: flex-start;
}

.tc-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
}

.tc-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tc-difficulty {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
}

.tc-difficulty.naked_eye {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.tc-difficulty.easy {
  color: var(--accent-blue);
  border-color: rgba(74, 158, 255, 0.4);
  background: rgba(74, 158, 255, 0.08);
}

.tc-difficulty.moderate {
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.tc-difficulty.hard {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.tc-eyepiece {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex: 1;
}

.tc-visible-now {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.tc-horizon-note {
  font-size: 0.72rem;
  color: var(--accent-gold);
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.tc-altitude {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ── Weekly Grid ────────────────────────────────────────────────────────── */
.weekly-grid {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  overflow-x: auto;
}

.day-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  min-width: 120px;
}

.day-card.today {
  border-color: rgba(74, 158, 255, 0.4);
  background: rgba(74, 158, 255, 0.06);
}

.day-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.day-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.day-rating {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.day-moon {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.day-weather {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.day-highlight {
  font-size: 0.68rem;
  color: var(--accent-gold);
  line-height: 1.4;
}

/* ── ISS ────────────────────────────────────────────────────────────────── */
.iss-tip {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  border-left: 2px solid rgba(74, 158, 255, 0.4);
  padding-left: 12px;
  line-height: 1.5;
}

.iss-passes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.iss-pass-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
}

.iss-pass-item.visible {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.04);
}

.iss-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-blue);
}

.iss-alt {
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

.iss-vis-label {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── Resources ──────────────────────────────────────────────────────────── */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 20px 24px;
}

.resource-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
}

.resource-card:hover {
  background: rgba(74, 158, 255, 0.06);
  border-color: rgba(74, 158, 255, 0.3);
  transform: translateY(-2px);
}

.resource-icon { font-size: 1.6rem; }

.resource-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.resource-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  background: rgba(10, 12, 21, 0.8);
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.footer-col h3 {
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.footer-col p {
  margin-bottom: 12px;
  line-height: 1.5;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links a::before {
  content: "›";
  margin-right: 8px;
  color: var(--accent);
  font-size: 1.2em;
  font-weight: bold;
}

.footer-socials {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.footer-socials a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
  text-decoration: none;
}

.footer-socials a:hover {
  color: #fff;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tech-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.back-to-top {
  background: var(--accent);
  color: #000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: bold;
  transition: opacity 0.2s;
}

.back-to-top:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    gap: 20px;
  }
}

/* ── Night Vision Mode ──────────────────────────────────────────────────── */
#night-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9998; /* Keep below floating btn (9999) */
  backdrop-filter: sepia(100%) hue-rotate(320deg) saturate(500%) brightness(0.8);
  -webkit-backdrop-filter: sepia(100%) hue-rotate(320deg) saturate(500%) brightness(0.8);
  background: rgba(5, 0, 0, 0.2);
}

body.night-mode #night-overlay {
  display: block;
}

body.night-mode {
  background-color: #050000;
}

.night-mode-wrapper {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 15px;
}

.night-tooltip {
  background: rgba(10, 10, 15, 0.9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  pointer-events: auto;
  /* animation removed so it stays until closed */
}

@keyframes fadeOutTooltip {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; display: none; }
}

.floating-night-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(10, 10, 15, 0.9);
  border: 1px solid rgba(255, 50, 50, 0.4);
  color: #ff4444;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.15);
  backdrop-filter: blur(5px);
}

.floating-night-btn:hover {
  background: rgba(40, 0, 0, 0.9);
  border-color: #ff0000;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.floating-tour-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.floating-tour-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
  .floating-night-btn {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }
  .floating-tour-btn {
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }
}

/* ── Loading Shimmer ────────────────────────────────────────────────────── */
.loading-shimmer {
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.no-data {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── API Status Indicator ───────────────────────────────────────────────── */
.api-status {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 10px;
  margin-left: auto;
}
.api-status.online {
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.api-status.offline {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── About Section ──────────────────────────────────────────────────────── */
.about-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
}
.about-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.about-modal-content {
  text-align: center;
  max-width: 500px;
}

.about-modal-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent-blue);
  margin-bottom: 20px;
}

.about-modal-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.about-highlights {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 25px 0;
  flex-wrap: wrap;
}

.about-highlights span {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.about-collab {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.about-collab p {
  margin-bottom: 15px;
  color: var(--text-primary);
}

.github-link {
  display: inline-block;
  background: var(--accent-blue);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.github-link:hover {
  background: #3a8ded;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

/* ── Mobile Optimization Sweep ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }
  .header-meta {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .weather-grid, .planets-grid, .target-grid, .card-row, .card-row-2, .iss-grid {
    grid-template-columns: 1fr !important;
  }
  .banner-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .card-header {
    flex-wrap: wrap;
  }
  .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    width: 100%;
  }
}
