/**
 * Cosmic Finance — 3 Distinct Homepage Presentation Architectures
 * 
 * Design 1: Cyber-Observatory Terminal (The Galactic Bloomberg Cockpit)
 * Design 2: Imperial Astrolabe & Orrery Vault (Luxury Royal Astronomical Wonder)
 * Design 3: 4D Spacetime Matrix & Vortex (Hyper-Dimensional Fly-Through Wormhole)
 */

/* ========================================================
   0. Persistent Floating Design Switcher Pill Bar
   ======================================================== */
.design-switcher-bar {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 10, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(242, 200, 121, 0.35);
  border-radius: 9999px;
  padding: 6px 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(242, 200, 121, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.design-switcher-bar:hover {
  border-color: rgba(242, 200, 121, 0.6);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(242, 200, 121, 0.25);
}

.switcher-label {
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  margin-right: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.switcher-label .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 8px var(--gold-400);
  animation: pulse-dot 1.8s infinite ease-in-out;
}

.switcher-btn {
  background: rgba(20, 24, 51, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.switcher-btn:hover {
  color: #ffffff;
  background: rgba(157, 130, 240, 0.2);
  border-color: rgba(157, 130, 240, 0.4);
}

.switcher-btn.active {
  background: linear-gradient(135deg, rgba(242, 200, 121, 0.28) 0%, rgba(157, 130, 240, 0.22) 100%);
  border: 1px solid var(--gold-400);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(242, 200, 121, 0.3);
}

@media (max-width: 860px) {
  .design-switcher-bar {
    top: auto;
    bottom: 20px;
    padding: 4px 10px;
    gap: 4px;
    max-width: 95vw;
    overflow-x: auto;
  }
  .switcher-label {
    display: none;
  }
  .switcher-btn {
    font-size: 0.72rem;
    padding: 5px 10px;
  }
}

/* Base Wrapper for all 3 designs */
.hero-variant-wrapper {
  display: none;
  width: 100%;
  animation: fadeInVariant 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-variant-wrapper.active {
  display: block;
}

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

/* ========================================================
   DESIGN 1: THE CYBER-OBSERVATORY TERMINAL
   ======================================================== */
.terminal-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-4);
  align-items: stretch;
  margin-top: 18px;
}

.terminal-radar-card {
  background: radial-gradient(circle at 50% 30%, rgba(13, 16, 36, 0.95) 0%, rgba(4, 5, 13, 0.98) 100%);
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(110, 231, 183, 0.04);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.terminal-sys-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #6ee7b7;
  text-transform: uppercase;
}

.terminal-radar-canvas-box {
  position: relative;
  width: 100%;
  height: 480px;
  background: radial-gradient(circle at 50% 50%, rgba(16, 24, 48, 0.6) 0%, rgba(4, 5, 13, 0.9) 70%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.terminal-radar-canvas-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.terminal-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.terminal-btn-group {
  display: flex;
  gap: 6px;
}

.terminal-toggle-btn {
  background: rgba(20, 24, 51, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-toggle-btn:hover {
  background: rgba(110, 231, 183, 0.15);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.4);
}

.terminal-toggle-btn.active {
  background: rgba(110, 231, 183, 0.22);
  color: #6ee7b7;
  border-color: #6ee7b7;
  box-shadow: 0 0 10px rgba(110, 231, 183, 0.25);
}

/* Terminal Right Deck: Multi-Instrument Market HUD */
.terminal-hud-deck {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hud-panel-card {
  background: var(--space-bg-card);
  border: 1px solid var(--space-border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
}

.hud-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.hud-market-tickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hud-ticker-cell {
  background: rgba(4, 5, 13, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.hud-ticker-cell:hover {
  border-color: var(--gold-400);
  transform: translateY(-1px);
}

.hud-ticker-name {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.hud-ticker-price {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}

.hud-ticker-change {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
}

.change-pos { color: var(--success-400); }
.change-neg { color: var(--negative-400); }

/* Aspect Beams Legend */
.aspect-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.aspect-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.aspect-line-indicator {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.line-trine { background: #6ee7b7; box-shadow: 0 0 6px #6ee7b7; }
.line-square { background: #f87171; box-shadow: 0 0 6px #f87171; }
.line-opposition { background: #ffd572; box-shadow: 0 0 6px #ffd572; }
.line-conjunction { background: #818cf8; box-shadow: 0 0 6px #818cf8; }

/* ========================================================
   DESIGN 2: THE IMPERIAL CELESTIAL ASTROLABE & ORRERY
   ======================================================== */
.astrolabe-stage-card {
  background: radial-gradient(circle at 50% 40%, rgba(20, 24, 51, 0.85) 0%, rgba(8, 10, 24, 0.98) 75%, rgba(4, 5, 13, 1) 100%);
  border: 1px solid rgba(242, 200, 121, 0.38);
  border-radius: var(--radius-xl);
  padding: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(242, 200, 121, 0.08);
  margin-top: 18px;
}

.astrolabe-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(242, 200, 121, 0.15);
  padding-bottom: 16px;
}

.astrolabe-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
}

.astrolabe-title-group h2 span {
  color: var(--gold-400);
}

.astrolabe-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.astrolabe-canvas-container {
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(242, 200, 121, 0.15);
  background: radial-gradient(circle at 50% 50%, rgba(13, 16, 36, 0.5) 0%, rgba(4, 5, 13, 0.95) 80%);
}

.astrolabe-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating Planetary Inspection Lens (Popup card on Planet Click) */
.planet-inspection-lens {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: rgba(13, 16, 36, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--gold-400);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  width: 320px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(242, 200, 121, 0.2);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.lens-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lens-planet-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-400);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lens-dignity-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(157, 130, 240, 0.2);
  color: var(--violet-300);
  border: 1px solid rgba(157, 130, 240, 0.4);
}

.lens-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lens-detail-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
}

.lens-asset-impact {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.4;
  background: rgba(242, 200, 121, 0.08);
  border-left: 3px solid var(--gold-400);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
}

/* Astrolabe Planetary Quick Selector Ribbon */
.astrolabe-planets-ribbon {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ribbon-planet-btn {
  background: rgba(20, 24, 51, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ribbon-planet-btn:hover {
  background: rgba(242, 200, 121, 0.15);
  border-color: var(--gold-400);
  color: #ffffff;
}

.ribbon-planet-btn.active {
  background: rgba(242, 200, 121, 0.25);
  border-color: var(--gold-400);
  color: var(--gold-300);
  box-shadow: 0 0 10px rgba(242, 200, 121, 0.2);
}

/* ========================================================
   DESIGN 3: THE 4D SPACETIME HELIX & VORTEX
   ======================================================== */
.vortex-stage-card {
  background: radial-gradient(circle at 50% 50%, rgba(13, 16, 36, 0.95) 0%, rgba(4, 5, 13, 1) 100%);
  border: 1px solid rgba(157, 130, 240, 0.35);
  border-radius: var(--radius-xl);
  padding: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), inset 0 0 60px rgba(157, 130, 240, 0.08);
  margin-top: 18px;
}

.vortex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(157, 130, 240, 0.15);
  padding-bottom: 14px;
}

.vortex-title-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(157, 130, 240, 0.15);
  border: 1px solid rgba(157, 130, 240, 0.35);
  color: var(--violet-300);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 6px;
}

.vortex-canvas-box {
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(157, 130, 240, 0.2);
  background: #020308;
}

.vortex-canvas-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Hyper-Space Warp Timeline Bar */
.vortex-warp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  background: rgba(8, 10, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  flex-wrap: wrap;
}

.warp-destination-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.warp-chip {
  background: rgba(20, 24, 51, 0.7);
  border: 1px solid rgba(157, 130, 240, 0.25);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.warp-chip:hover {
  background: rgba(157, 130, 240, 0.25);
  color: #ffffff;
  border-color: var(--violet-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(157, 130, 240, 0.3);
}

.warp-chip.active {
  background: linear-gradient(135deg, rgba(157, 130, 240, 0.35) 0%, rgba(242, 200, 121, 0.25) 100%);
  border-color: var(--gold-400);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(157, 130, 240, 0.4);
}

.warp-telemetry-hud {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.warp-hud-metric {
  display: flex;
  flex-direction: column;
}

.warp-metric-name {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.warp-metric-val {
  font-weight: 700;
  color: var(--gold-400);
  font-variant-numeric: tabular-nums;
}

/* Responsive constraints for all 3 designs */
@media (max-width: 1024px) {
  .terminal-layout {
    grid-template-columns: 1fr;
  }
  .terminal-radar-canvas-box {
    height: 400px;
  }
  .astrolabe-canvas-container {
    height: 420px;
  }
  .vortex-canvas-box {
    height: 420px;
  }
  .planet-inspection-lens {
    width: calc(100% - 48px);
    bottom: 12px;
    left: 24px;
  }
}

@media (max-width: 640px) {
  .terminal-radar-canvas-box {
    height: 320px;
  }
  .astrolabe-canvas-container {
    height: 340px;
  }
  .vortex-canvas-box {
    height: 340px;
  }
  .astrolabe-stage-card,
  .vortex-stage-card,
  .terminal-radar-card {
    padding: 16px;
  }
}
