/* Reset básico y eliminación de scroll */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto", sans-serif;
  color: #f5f7ff;
}

/* Fondo "Dark Space" */
body {
  background: radial-gradient(circle at 20% 20%, #0b1024 0, #02030a 40%, #000000 100%);
  position: relative;
}

/* Estrellas suaves */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 80% 60%, rgba(155, 200, 255, 0.35), transparent),
    radial-gradient(2px 2px at 40% 80%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 70% 30%, rgba(180, 220, 255, 0.3), transparent);
  z-index: 0;
}

#app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

/* Panel de control con glassmorphism */
#glass-panel {
  position: relative;
  z-index: 2;
  width: 600px;
  max-width: 60vw;
  padding: 18px 20px 20px;
  margin: 14px;
  border-radius: 18px;
  background: rgba(8, 15, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #f9fbff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#glass-panel h1 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.subtitle {
  font-size: 0.8rem;
  color: #a9b4d8;
  line-height: 1.4;
}

/* Controles y grupos */
.controls-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

@media (min-width: 900px) {
  .controls-row {
    flex-direction: row;
  }
}

.control-group {
  flex: 1;
  min-width: 0;
}

.control-group h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8ea4ff;
  margin-bottom: 6px;
}

.hint {
  font-size: 0.75rem;
  color: #97a4cc;
  margin-top: 8px;
  line-height: 1.4;
}

/* Filtros de bloques */
#filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 29, 66, 0.9);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 0.72rem;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  max-width: 100%;
}

.filter-pill input[type="checkbox"] {
  accent-color: #8ea4ff;
  cursor: pointer;
}

.filter-pill span.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.filter-pill span.label {
  display: inline-block;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-pill.active {
  border-color: rgba(142, 164, 255, 0.9);
  background: linear-gradient(135deg, rgba(84, 115, 255, 0.9), rgba(137, 85, 255, 0.8));
  box-shadow: 0 8px 22px rgba(71, 98, 255, 0.65);
  transform: translateY(-1px);
}

.filter-pill.active span.label {
  color: #0a0d23;
  font-weight: 600;
}

/* Botón primario glass */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(183, 210, 255, 0.35);
  background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.18), rgba(32, 49, 122, 0.9));
  color: #fdfdff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 12px 30px rgba(29, 55, 151, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 40px rgba(31, 82, 255, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.22), rgba(46, 82, 214, 0.95));
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(10, 20, 60, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Contenedor del gráfico */
#graph-container {
  flex: 1;
  position: relative;
  z-index: 1;
}

#3d-graph {
  width: 100%;
  height: 100%;
}

/* Panel de información derecha (glassmorphism) */
.info-panel {
  position: absolute;
  bottom: 14px;
  right: -420px;
  z-index: 2;
  width: 360px;
  max-width: 40vw;
  margin: 0 14px 14px 0;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: rgba(4, 10, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  color: #f9fbff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 960px) {
  .info-panel {
    display: none;
  }
}

.info-panel.hidden {
  opacity: 0;
  pointer-events: none;
  right: -420px;
  transition:
    opacity 0.25s ease-out,
    right 0.25s ease-out;
}

.info-panel.visible {
  opacity: 1;
  pointer-events: auto;
  right: 14px;
}

.info-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.info-panel-header h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.info-close-btn {
  border: none;
  background: transparent;
  color: #9fa9d6;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease;
}

.info-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.info-block-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a5b4ff;
}

.info-description {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #d5ddff;
  white-space: pre-line;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(183, 210, 255, 0.35);
  background: rgba(18, 29, 66, 0.6);
  color: #fdfdff;
  font-size: 0.82rem;
  outline: none;
  box-shadow:
    0 8px 20px rgba(29, 55, 151, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.search-input::placeholder {
  color: #a9b4d8;
}

.search-input:focus {
  transform: translateY(-1px);
  background: rgba(32, 49, 122, 0.8);
  box-shadow:
    0 12px 30px rgba(31, 82, 255, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}
.nav-panel {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  width: 340px;
  max-width: 42vw;
  margin: 0 0 14px 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(6, 12, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #eef2ff;
}

.nav-block-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9fb2ff;
}

.nav-concept-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(183, 210, 255, 0.35);
  background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.18), rgba(32, 49, 122, 0.9));
  color: #fdfdff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 12px 30px rgba(29, 55, 151, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 40px rgba(31, 82, 255, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.22), rgba(46, 82, 214, 0.95));
}

.nav-counter {
  font-size: 0.9rem;
  color: #dbe3ff;
}

