/* ==============================================================
 * Solar System 3D Simulation Stylesheet
 * Deep Space Glassmorphism HUD, Movie Trailer Credits & Cyberpunk Accents
 * Author: Praful Kumar (git@gitlab.com:prafulkr/solarsystem-3d.git)
 * ============================================================== */

:root {
  --bg-dark: #070a13;
  --panel-bg: rgba(13, 20, 36, 0.78);
  --panel-border: rgba(56, 189, 248, 0.22);
  --accent-cyan: #38bdf8;
  --accent-gold: #fbbf24;
  --accent-blue: #3b82f6;
  --accent-red: #f43f5e;
  --accent-emerald: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: var(--text-primary);
}

/* 3D Canvas */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Fast Auto-Fade Intro Splash Screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #0b1329 0%, #02040a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
  cursor: pointer;
}

#loading-screen.fade-out {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.loader-orbit-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-sun {
  width: 26px;
  height: 26px;
  background: radial-gradient(circle, #ffffff 0%, #fffaed 30%, #ffaa00 70%, #ff5500 100%);
  border-radius: 50%;
  box-shadow: 0 0 25px #ffaa00, 0 0 50px #ff6600;
  animation: pulseSun 2s infinite alternate ease-in-out;
}

@keyframes pulseSun {
  from { transform: scale(0.92); box-shadow: 0 0 20px #ffaa00; }
  to { transform: scale(1.15); box-shadow: 0 0 40px #ffaa00, 0 0 70px #ff6600; }
}

.loader-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.35);
}

.loader-orbit::before {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.ring-1 {
  width: 48px;
  height: 48px;
  animation: rotateOrbit 2.4s linear infinite;
}
.ring-1::before {
  top: -3px; left: 21px; width: 6px; height: 6px;
  background: #38bdf8; box-shadow: 0 0 8px #38bdf8;
}

.ring-2 {
  width: 72px;
  height: 72px;
  animation: rotateOrbit 4.2s linear infinite reverse;
}
.ring-2::before {
  top: -4px; left: 32px; width: 8px; height: 8px;
  background: #fbbf24; box-shadow: 0 0 10px #fbbf24;
}

.ring-3 {
  width: 98px;
  height: 98px;
  animation: rotateOrbit 6.8s linear infinite;
}
.ring-3::before {
  top: -5px; left: 44px; width: 9px; height: 9px;
  background: #3b82f6; box-shadow: 0 0 12px #3b82f6;
}

@keyframes rotateOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  margin-bottom: 6px;
}

.loading-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.loading-subtitle strong {
  color: var(--accent-gold);
}

.splash-click-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Glassmorphism Common */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: auto;
}

/* Header HUD */
.header-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.brand-badge {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
}

.sim-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.time-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.time-btn.paused {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

#time-speed-slider {
  width: 110px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.speed-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 40px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover, .icon-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Left Tools / View Panel */
.left-view-panel {
  position: absolute;
  top: 90px;
  left: 16px;
  width: 220px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
}

.panel-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.view-btn-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.view-nav-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.view-nav-btn:hover, .view-nav-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.toggles-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-cyan);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

#cockpit-hint {
  display: none;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.4;
}

/* Right Telemetry HUD (Hidden by default, slides in on planet selection) */
.right-telemetry-hud {
  position: absolute;
  top: 90px;
  right: 16px;
  width: 340px;
  max-height: calc(100vh - 190px);
  padding: 20px;
  overflow-y: auto;
  z-index: 10;
  transform: translateX(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.right-telemetry-hud.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.right-telemetry-hud::-webkit-scrollbar {
  width: 5px;
}
.right-telemetry-hud::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 10px;
}

.hud-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-close-btn:hover {
  background: rgba(244, 63, 94, 0.3);
  border-color: var(--accent-red);
  color: #ffffff;
  transform: scale(1.1);
}

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

.hud-title-group h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hud-type-tag {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.hud-symbol {
  font-size: 1.8rem;
  color: var(--accent-gold);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.telemetry-cell {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cell-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
}

.cell-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.telemetry-full-row {
  grid-column: span 2;
}

.overview-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--accent-cyan);
  padding: 10px;
  border-radius: 0 8px 8px 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.fact-box {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--accent-gold);
  padding: 10px;
  border-radius: 0 8px 8px 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #fef08a;
}

/* Bottom Quick Nav Carousel */
.bottom-quick-nav {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 95vw;
  overflow-x: auto;
  z-index: 10;
}

.bottom-quick-nav::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-pill:hover, .nav-pill.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Bottom Executive Footer Branding Bar */
.app-footer-bar {
  position: absolute;
  bottom: 8px;
  left: 16px;
  right: 16px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  z-index: 9;
}

.footer-social-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==============================================================
 * Movie Credits & Comparison Modals
 * ============================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  width: 90%;
  max-width: 760px;
  padding: 24px;
}

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

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* Trailer Modal Grid */
.trailer-credits-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trailer-credit-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 14px;
}

.trailer-credit-card.full-span {
  grid-column: span 2;
}

.credit-role {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.credit-person {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

.credit-detail {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.cast-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cast-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  color: var(--text-primary);
}

.btn-enter-mission {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.5);
  transition: all 0.2s;
}

.btn-enter-mission:hover {
  transform: scale(1.04);
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.8);
}

.btn-tour-mission {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tour-mission:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-column {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-select {
  width: 100%;
  background: #1e293b;
  border: 1px solid var(--accent-cyan);
  color: white;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.compare-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.compare-stat-label {
  color: var(--text-muted);
}

.compare-stat-val {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 600;
}
