/**
 * CosmosStudio 3D - Hoja de Estilos de Alta Fidelidad
 * Fijate Tools • Estética Deep Space HUD, Glassmorphism y Adaptabilidad Móvil
 */

:root {
  --cosmos-bg: #030712;
  --cosmos-card-bg: rgba(15, 23, 42, 0.78);
  --cosmos-card-border: rgba(56, 189, 248, 0.2);
  --cosmos-accent: #38bdf8;
  --cosmos-accent-glow: rgba(56, 189, 248, 0.35);
  --cosmos-amber: #fbbf24;
  --cosmos-text-main: #f8fafc;
  --cosmos-text-muted: #94a3b8;
  --cosmos-hud-bg: rgba(11, 19, 38, 0.88);
  --cosmos-hud-border: rgba(148, 163, 184, 0.18);
  --cosmos-radius: 14px;
  --cosmos-radius-sm: 8px;
}

/* 1. Contenedor de la herramienta y contención de layout */
body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--cosmos-bg);
  color: var(--cosmos-text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

.mono-num {
  font-family: 'JetBrains Mono', monospace;
}

.tool-layout {
  max-width: 1320px;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
}

.tool-main-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 2. Escenario 3D inmersivo y HUD flotante */
.solar-stage-wrapper {
  position: relative;
  width: 100%;
  height: clamp(540px, 75vh, 840px);
  min-height: 520px;
  border-radius: var(--cosmos-radius);
  overflow: hidden;
  border: 1px solid var(--cosmos-card-border);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.08);
  background: #02040a;
}

.solar-stage-wrapper.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  z-index: 99999;
  border-radius: 0;
  border: none;
}

.solar-canvas-container {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.solar-canvas-container:active {
  cursor: grabbing;
}

/* 2b. Pantalla de carga cinemática cósmica */
.solar-loader-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 10, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.55s ease;
  pointer-events: auto;
}

.solar-loader-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.solar-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 2.2rem 2.5rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--cosmos-card-border);
  border-radius: var(--cosmos-radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
  max-width: 90%;
  width: 320px;
}

.solar-spinner-rings {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid transparent;
}

.spinner-ring.ring-1 {
  width: 76px;
  height: 76px;
  border-top-color: var(--cosmos-accent);
  border-bottom-color: rgba(56, 189, 248, 0.3);
  animation: orbit-rotate 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner-ring.ring-2 {
  width: 52px;
  height: 52px;
  border-left-color: #818cf8;
  border-right-color: rgba(129, 140, 248, 0.3);
  animation: orbit-rotate-reverse 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner-ring.ring-3 {
  width: 32px;
  height: 32px;
  border-top-color: #38bdf8;
  border-left-color: rgba(56, 189, 248, 0.2);
  animation: orbit-rotate 1.2s linear infinite;
}

.spinner-core-sun {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 30%, #ea580c 100%);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.9);
  animation: sun-pulse 1.8s ease-in-out infinite;
}

@keyframes orbit-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes orbit-rotate-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes sun-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 20px rgba(251, 191, 36, 1); }
}

.solar-loader-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cosmos-text-main);
  letter-spacing: -0.01em;
}

.solar-loader-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.solar-loader-bar-fill {
  width: 10%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.solar-loader-status {
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cosmos-text-muted);
  min-height: 1.2em;
}

/* 3. Controles del HUD superior flotante */
.solar-hud-top {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: none;
  z-index: 10;
  flex-wrap: wrap;
}

.solar-hud-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cosmos-hud-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.35rem 0.5rem;
  border-radius: 40px;
  border: 1px solid var(--cosmos-hud-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.solar-hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 38px;
  min-width: 38px;
  padding: 0 0.75rem;
  border-radius: 30px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cosmos-text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.solar-hud-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cosmos-accent);
}

.solar-hud-btn.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cosmos-accent);
  color: var(--cosmos-accent);
  box-shadow: 0 0 12px var(--cosmos-accent-glow);
}

.solar-hud-btn.btn-icon-only {
  padding: 0;
  width: 38px;
  height: 38px;
}

.solar-time-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cosmos-accent);
}

/* 3b. Buscador Cósmico Omnibar */
.solar-search-box {
  position: relative;
  pointer-events: auto;
  z-index: 25;
}

.solar-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--cosmos-hud-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: 40px;
  padding: 0 0.75rem;
  height: 42px;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.solar-search-input-wrap:focus-within {
  min-width: 270px;
  max-width: 380px;
  border-color: var(--cosmos-accent);
  box-shadow: 0 0 16px var(--cosmos-accent-glow), 0 4px 20px rgba(0, 0, 0, 0.6);
}

.search-icon {
  color: var(--cosmos-text-muted);
  flex-shrink: 0;
}

.solar-search-input-wrap:focus-within .search-icon {
  color: var(--cosmos-accent);
}

.solar-search-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--cosmos-text-main);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
}

.solar-search-input::placeholder {
  color: var(--cosmos-text-muted);
  opacity: 0.85;
}

.search-kbd-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cosmos-text-muted);
  user-select: none;
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--cosmos-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s;
}

.btn-clear-search:hover {
  color: #fff;
}

.solar-search-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  min-width: 290px;
  max-height: 380px;
  overflow-y: auto;
  background: rgba(11, 19, 38, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--cosmos-card-border);
  border-radius: var(--cosmos-radius);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 20px rgba(56, 189, 248, 0.1);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.solar-search-dropdown::-webkit-scrollbar {
  width: 5px;
}
.solar-search-dropdown::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--cosmos-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.search-result-item:hover,
.search-result-item.is-selected {
  background: rgba(56, 189, 248, 0.15);
  box-shadow: inset 0 0 0 1px var(--cosmos-accent);
}

.search-item-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.search-item-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.search-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--cosmos-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.search-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cosmos-text-muted);
}

.search-cat-badge.cat-cinturon {
  background: rgba(147, 197, 253, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.3);
}

.search-cat-badge.cat-satelite {
  background: rgba(203, 213, 225, 0.18);
  color: #cbd5e1;
}

.search-cat-badge.cat-planeta {
  background: rgba(56, 189, 248, 0.18);
  color: var(--cosmos-accent);
}

.search-cat-badge.cat-cometa {
  background: rgba(56, 189, 248, 0.25);
  color: #67e8f9;
}

.search-cat-badge.cat-planeta_enano {
  background: rgba(251, 191, 36, 0.18);
  color: var(--cosmos-amber);
}

.search-empty-state {
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--cosmos-text-muted);
}

/* 4. Barra inferior de acceso rápido a planetas */
.solar-hud-bottom {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.solar-planet-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--cosmos-hud-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.4rem;
  border-radius: 40px;
  border: 1px solid var(--cosmos-hud-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.solar-planet-bar::-webkit-scrollbar {
  display: none;
}

.btn-planet-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 38px;
  padding: 0 0.8rem;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cosmos-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-planet-nav:hover {
  color: var(--cosmos-text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-planet-nav.is-active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cosmos-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 14px var(--cosmos-accent-glow);
}

.planet-dot-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px currentColor;
}

/* 5. Panel lateral deslizable (Ficha científica / Drawer) */
.planet-drawer {
  position: absolute;
  top: 4.6rem;
  right: 1rem;
  bottom: 5.2rem;
  width: 380px;
  max-width: calc(100% - 2rem);
  background: var(--cosmos-hud-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--cosmos-card-border);
  border-radius: var(--cosmos-radius);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  z-index: 15;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.planet-drawer.is-collapsed {
  transform: translateX(calc(100% + 2rem));
  pointer-events: none;
}

.drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--cosmos-hud-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 19, 38, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 2;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-symbol-box {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--cosmos-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cosmos-accent);
}

.drawer-symbol-box svg {
  width: 20px;
  height: 20px;
}

.drawer-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cosmos-text-main);
  line-height: 1.2;
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--cosmos-text-muted);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--cosmos-text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.drawer-content::-webkit-scrollbar {
  width: 6px;
}
.drawer-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 10px;
}

/* Botón flotante para reabrir el panel si está colapsado */
.btn-open-drawer-tab {
  position: absolute;
  top: 4.6rem;
  right: 1rem;
  z-index: 12;
  background: var(--cosmos-hud-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--cosmos-card-border);
  color: var(--cosmos-accent);
  padding: 0.5rem 0.9rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Distintivo flotante de escala didáctica en el canvas */
.solar-scale-pill {
  position: absolute;
  top: 4.6rem;
  left: 1rem;
  z-index: 12;
  background: var(--cosmos-hud-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--cosmos-card-border);
  color: var(--cosmos-text-muted);
  padding: 0.5rem 0.9rem;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  user-select: none;
}

.solar-scale-pill:hover {
  border-color: var(--cosmos-accent);
  color: var(--cosmos-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.2);
}

.solar-scale-pill .scale-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cosmos-accent);
  box-shadow: 0 0 8px var(--cosmos-accent);
  flex-shrink: 0;
}

.solar-scale-pill svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.solar-scale-pill:hover svg {
  opacity: 1;
}

/* 6. Rejilla de métricas de telemetría */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.telemetry-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: var(--cosmos-radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.telemetry-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cosmos-text-muted);
}

.telemetry-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cosmos-text-main);
}

.telemetry-sub {
  font-size: 0.75rem;
  color: var(--cosmos-accent);
}

/* 7. Barra apilada de atmósfera */
.drawer-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.65rem 0;
  color: var(--cosmos-text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.atmos-stacked-bar {
  display: flex;
  height: 10px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 0.75rem;
}

.atmos-bar-slice {
  height: 100%;
  transition: width 0.3s ease;
}

.atmos-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.75rem;
}

.atmos-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.atmos-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.atmos-name {
  color: var(--cosmos-text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atmos-percent {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--cosmos-text-main);
}

/* 8. Capas internas y misiones */
.layers-list, .missions-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.layer-item {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: var(--cosmos-radius-sm);
  padding: 0.65rem;
}

.layer-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: var(--cosmos-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.layer-info h4 {
  margin: 0 0 0.2rem 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.layer-desc {
  margin: 0;
  font-size: 0.75rem;
  color: var(--cosmos-text-muted);
  line-height: 1.4;
}

.mission-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: var(--cosmos-radius-sm);
  padding: 0.65rem 0.8rem;
}

.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.mission-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--cosmos-text-main);
}

.mission-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--cosmos-accent);
}

.mission-goal {
  margin: 0;
  font-size: 0.75rem;
  color: var(--cosmos-text-muted);
  line-height: 1.4;
}

/* 9. Curiosidades científicas */
.curiosities-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.curiosity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--cosmos-text-main);
  line-height: 1.45;
}

.curiosity-icon {
  color: var(--cosmos-amber);
  flex-shrink: 0;
  margin-top: 2px;
}

/* 10. Calculadora de peso interplanetario */
.weight-calc-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: var(--cosmos-radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.weight-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: var(--cosmos-radius-sm);
  overflow: hidden;
}

.weight-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0.6rem 0.8rem;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
}

.weight-unit {
  padding: 0 0.8rem;
  color: var(--cosmos-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.weight-hero-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--cosmos-hud-border);
}

.weight-hero-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cosmos-amber);
}

.weight-all-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.weight-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.weight-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.weight-row.is-selected {
  background: rgba(56, 189, 248, 0.12);
}

.weight-col-name {
  width: 65px;
  font-size: 0.75rem;
  color: var(--cosmos-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-col-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.weight-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.weight-col-val {
  width: 55px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cosmos-text-main);
}

/* 11. Comparador de tamaños */
.size-compare-stage {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: var(--cosmos-radius-sm);
}

.size-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.size-sphere {
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.size-label {
  font-size: 0.75rem;
  font-weight: 600;
}

.size-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--cosmos-text-muted);
}

.size-vs {
  font-size: 0.75rem;
  color: var(--cosmos-text-muted);
  font-weight: 600;
}

.size-compare-scale-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: var(--cosmos-radius-sm);
  font-size: 0.75rem;
  color: var(--cosmos-text-muted);
  line-height: 1.45;
}

.size-compare-scale-badge svg {
  flex-shrink: 0;
  color: var(--cosmos-accent);
}

/* 12. Sección educativa inferior (Guía y FAQ SEO) */
.card-content-section {
  background: var(--cosmos-card-bg);
  border: 1px solid var(--cosmos-card-border);
  border-radius: var(--cosmos-radius);
  padding: 2rem;
  margin-top: 1rem;
}

.section-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--cosmos-text-main);
}

.section-desc-lead {
  font-size: 1rem;
  color: var(--cosmos-text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.faq-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--cosmos-hud-border);
  border-radius: var(--cosmos-radius-sm);
  padding: 1.25rem;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--cosmos-accent);
}

.faq-answer {
  font-size: 0.88rem;
  color: var(--cosmos-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* 13. Modal nativo */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-modal-backdrop.is-open {
  display: flex;
}

.app-modal-card {
  background: #0b1329;
  border: 1px solid var(--cosmos-card-border);
  border-radius: var(--cosmos-radius);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.app-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--cosmos-hud-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cosmos-text-main);
}

.app-modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--cosmos-text-muted);
}

.app-modal-body h4 {
  color: var(--cosmos-accent);
  margin: 1rem 0 0.5rem 0;
}

.app-modal-body h4:first-child {
  margin-top: 0;
}

.help-list {
  padding-left: 1.2rem;
  margin: 0.5rem 0 1rem 0;
}

.help-list li {
  margin-bottom: 0.4rem;
}

.scale-notice-card {
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  color: var(--cosmos-text-main);
}

.scale-notice-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cosmos-accent);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.scale-notice-card p {
  margin: 0.45rem 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.scale-notice-foot {
  margin-top: 0.65rem !important;
  font-size: 0.8rem !important;
  color: #94a3b8 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.55rem;
}

.app-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--cosmos-hud-border);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-action {
  height: 42px;
  min-width: 100px;
  padding: 0 1.25rem;
  border-radius: 8px;
  border: none;
  background: var(--cosmos-accent);
  color: #02040a;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-modal-action:hover {
  opacity: 0.9;
}

/* 14. Adaptaciones y responsividad móvil */
@media (max-width: 900px) {
  .planet-drawer {
    top: auto;
    bottom: 5.5rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
    height: 48vh;
  }

  .solar-stage-wrapper {
    height: 65vh;
    min-height: 480px;
  }
}

@media (max-width: 600px) {
  .solar-hud-top {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }

  .solar-hud-bottom {
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }

  .btn-planet-nav {
    padding: 0 0.6rem;
    font-size: 0.78rem;
  }

  .card-content-section {
    padding: 1.25rem;
  }

  .solar-scale-pill {
    top: auto;
    bottom: 4.4rem;
    left: 0.5rem;
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }
}
