/* ================================================================
   ORION Observatory — Constellation Roadmap
   Interactive star map + topic detail panel
   ================================================================ */

/* --c-blue*/--c-gold* were retired app-wide as a "dead" palette (they'd
   already collapsed to plain white/white-glow before that retirement — never
   actually blue or gold). Reverting this file to its pre-2026-07-25 state
   per explicit request, so they're restored here, scoped to just this file
   rather than resurrected globally — nothing else in the app still uses them. */
:root {
  --c-blue:        #ffffff;
  --c-blue-glow:   rgba(255, 255, 255, 0.15);
  --c-gold:        #ffffff;
  --c-gold-glow:   rgba(255, 255, 255, 0.15);
}

/* ── Container ── */
.constellation {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--sp-16));
  min-height: 500px;
}

/* ── Orbit Selector ── */
.constellation__orbits {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.constellation__orbit-label {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--c-white-ghost);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Star Map ── */
.constellation__map-container {
  flex: 1;
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgba(6, 8, 15, 0.5);
  border: 1px solid var(--glass-border);
}

.constellation__map {
  width: 100%;
  height: 100%;
  cursor: grab;
}

.constellation__map:active {
  cursor: grabbing;
}

.constellation__map svg {
  width: 100%;
  height: 100%;
}

/* ── Constellation Lines ── */
.constellation__line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  fill: none;
  transition: stroke var(--t-base) var(--ease-out);
}

.constellation__line--active {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
}

.constellation__line--complete {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 1.5;
  stroke-dasharray: none;
  animation: drawLine 1.5s ease-out forwards;
}

/* ── Star Nodes ── */
.constellation__star {
  cursor: pointer;
  transition: all var(--t-base) var(--ease-out);
}

.constellation__star:hover {
  filter: brightness(1.3);
}

.constellation__star-core {
  transition: all var(--t-base) var(--ease-out);
}

.constellation__star-glow {
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
}

.constellation__star:hover .constellation__star-glow {
  opacity: 0.6;
}

/* Star States */
.constellation__star--locked .constellation__star-core {
  fill: var(--c-white-ghost);
  opacity: 0.4;
}

.constellation__star--available .constellation__star-core {
  fill: var(--c-white-dim);
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.2));
}

.constellation__star--active .constellation__star-core {
  fill: var(--c-blue);
  filter: drop-shadow(0 0 8px var(--c-blue-glow));
  animation: starPulse 2s ease-in-out infinite;
}

.constellation__star--complete .constellation__star-core {
  fill: var(--c-gold);
  filter: drop-shadow(0 0 8px var(--c-gold-glow));
}

/* ── Selected Star Detail Panel ── */
.constellation__detail {
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: rgba(6, 8, 15, 0.92);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  padding: var(--sp-6);
  transform: translateX(100%);
  transition: transform var(--t-slow) var(--ease-out);
  overflow-y: auto;
  z-index: 5;
  display: flex;
  flex-direction: column;
}

.constellation__detail--open {
  transform: translateX(0);
}

.constellation__detail-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--c-white-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: all var(--t-fast) var(--ease-out);
}

.constellation__detail-close:hover {
  background: var(--glass-bg-hover);
  color: var(--c-white);
}

.constellation__detail-name {
  font-family: var(--f-heading);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
  padding-right: var(--sp-8);
}

.constellation__detail-sub {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--c-white-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-6);
}

.constellation__detail-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-2);
}

.constellation__detail-pct {
  font-family: var(--f-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-blue);
}

.constellation__detail-ly {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--c-white-muted);
}

.constellation__detail-count {
  font-size: var(--fs-sm);
  color: var(--c-white-muted);
  margin-bottom: var(--sp-6);
}

.constellation__detail-lessons {
  flex: 1;
  margin-bottom: var(--sp-6);
}

.constellation__detail-lesson-title {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--c-white-ghost);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.constellation__detail-enter {
  margin-top: auto;
  width: 100%;
  padding: var(--sp-4);
  font-size: var(--fs-base);
}

/* ── Map Controls ── */
.constellation__controls {
  position: absolute;
  bottom: var(--sp-4);
  left: var(--sp-4);
  display: flex;
  gap: var(--sp-2);
  z-index: 3;
}

.constellation__zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: rgba(6, 8, 15, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--c-white-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--fs-lg);
  font-family: var(--f-mono);
  backdrop-filter: var(--glass-blur);
  transition: all var(--t-fast) var(--ease-out);
}

.constellation__zoom-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--c-white);
  border-color: var(--glass-border-h);
}

/* ── Legend ── */
.constellation__legend {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-top: var(--sp-4);
}

.constellation__legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  color: var(--c-white-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.constellation__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .constellation__detail {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .constellation {
    height: auto;
    min-height: auto;
  }

  .constellation__map-container {
    height: 400px;
  }

  .constellation__detail {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60vh;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%);
  }

  .constellation__detail--open {
    transform: translateY(0);
  }

  .constellation__legend {
    flex-wrap: wrap;
    gap: var(--sp-3);
  }
}
