/* CEREBRO DIGITAL · IDENTIDAD VISUAL TERRA PERPETUA (www.terraperpetua.com) */

:root {
  /* Tokens Oficiales de Terra Perpetua */
  --ink: #102D46;          /* Azul marino corporativo profundo */
  --paper: #F6F3ED;        /* Marfil pergamino cálido */
  --white: #FFFFFF;
  --blue: #2766A4;         /* Azul acento Terra Perpetua */
  --sand: #C4AE8F;         /* Ocre arena cálido para cejas, tags y datos */
  --muted: #516674;        /* Gris azulado para textos secundarios */
  --line: #DCEAF3;         /* Línea sutil de división clara */
  --line-dark: rgba(255, 255, 255, 0.14);
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* Categorías Semánticas afinadas a la paleta mineral de Terra Perpetua */
  --color-suelo: #C4AE8F;        /* Arena/Ocre */
  --color-burocracia: #E28743;   /* Terracota arquitectónica */
  --color-construccion: #2766A4; /* Azul Terra */
  --color-finanzas: #52B788;     /* Verde menta sobrio */
  --color-fiscalidad: #028090;   /* Petróleo azul */
  --color-alquiler: #E63946;     /* Carmesí sobrio */
  --color-demografia: #9D4EDD;   /* Amatista */
  --color-politicas: #457B9D;    /* Azul pizarra */
  --color-impacto: #F6F3ED;      /* Pergamino */
}

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

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--ink);
  color: var(--paper);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Canvas pantalla completa */
#brain-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  background-color: var(--ink);
}

/* Glassmorphism y Paneles Terra Perpetua */
.glass-panel {
  background: rgba(16, 45, 70, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-dark);
  box-shadow: 0 16px 45px -10px rgba(0, 0, 0, 0.65);
}

.glass-card {
  background: rgba(16, 45, 70, 0.65);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-dark);
}

/* Barra de scroll personalizada estilo Terra Perpetua */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(16, 45, 70, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(196, 174, 143, 0.28);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(196, 174, 143, 0.55);
}

/* Animaciones y Efectos */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 3.5s infinite ease-in-out;
}

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

.animate-fade-in {
  animation: fadeIn 0.25s var(--ease) forwards;
}

/* Ceja arquitectónica (estilo www.terraperpetua.com) */
.eyebrow {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.095em;
  text-transform: uppercase;
  color: var(--sand);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: currentColor;
  display: inline-block;
}

/* Botones estilo píldora Terra Perpetua */
.terra-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  text-decoration: none;
}
.terra-pill-btn:hover {
  transform: translateY(-1px);
}

/* PANEL LATERAL IZQUIERDO DE NAVEGACIÓN Y CONTROL (#navigation-sidebar) */
#navigation-sidebar {
  transition: transform 0.35s var(--ease);
  width: 400px;
  max-width: 92vw;
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
  border-right: 1px solid var(--line-dark);
}

/* PANEL LATERAL DE INSPECCIÓN DERECHO A DOBLE ANCHO (#inspection-drawer) */
#inspection-drawer {
  transition: transform 0.35s var(--ease), width 0.3s ease;
  width: 1050px;
  max-width: 95vw;
  box-shadow: -20px 0 55px rgba(0, 0, 0, 0.85);
  border-left: 1px solid var(--line-dark);
}

#inspection-drawer.fullscreen-drawer {
  width: 100vw !important;
  max-width: 100vw !important;
  z-index: 50;
}

/* Layout en dos columnas ergonómico para el panel de 1.050px */
.drawer-grid-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .drawer-grid-layout {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    gap: 1.5rem;
    align-items: start;
  }
}

/* PESTAÑAS INTERNAS DEL DRAWER (AMPLIADAS Y ERGONÓMICAS) */
.drawer-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 45, 70, 0.8);
  color: var(--paper);
  transition: all 0.22s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.drawer-tab-btn:hover {
  background: rgba(39, 102, 164, 0.35);
  border-color: var(--blue);
  color: var(--white);
  transform: translateY(-1.5px);
}
.drawer-tab-btn.active {
  background: var(--blue) !important;
  color: var(--white) !important;
  border-color: var(--blue) !important;
  box-shadow: 0 4px 18px rgba(39, 102, 164, 0.45);
}

/* Botones de salto interactivo (jump) */
.jump-node-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.18s ease;
}
.jump-node-btn:hover {
  transform: translateX(2px);
}
.jump-node-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: currentColor;
  opacity: 0.7;
}

/* Badges temáticos y mono */
.tag-badge {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Filtros y tarjetas de actores */
.actor-card-item {
  transition: all 0.2s var(--ease);
}
.actor-card-item:hover {
  border-color: var(--sand);
  transform: translateY(-1px);
}
.actor-card-item.active {
  box-shadow: 0 0 16px rgba(196, 174, 143, 0.3);
  border-color: var(--sand);
}

/* ACORDEÓN DESPLEGABLE DE FUENTES Y ENLACES EXTERNOS (.terra-accordion) */
.terra-accordion {
  border: 1px solid var(--line-dark);
  background: rgba(8, 24, 40, 0.75);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}
.terra-accordion summary {
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background: rgba(16, 45, 70, 0.9);
  border-bottom: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.terra-accordion summary:hover {
  background: rgba(39, 102, 164, 0.25);
}
.terra-accordion[open] summary {
  border-bottom-color: var(--line-dark);
  background: rgba(39, 102, 164, 0.2);
}
.terra-accordion summary::-webkit-details-marker {
  display: none;
}
.terra-accordion-arrow {
  font-size: 11px;
  color: var(--sand);
  transition: transform 0.3s var(--ease);
}
.terra-accordion[open] .terra-accordion-arrow {
  transform: rotate(180deg);
}

.terra-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 8px;
  background: rgba(16, 45, 70, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--paper);
}
.terra-link-card:hover {
  background: rgba(39, 102, 164, 0.3);
  border-color: var(--blue);
  transform: translateX(3px);
  color: var(--white);
}

/* Tarjeta de solución internacional */
#drawer-solution-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(16, 45, 70, 0.95) 0%, rgba(8, 24, 40, 0.9) 100%);
  border: 1px solid rgba(196, 174, 143, 0.35);
}
#drawer-solution-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(196, 174, 143, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* Modos de audiencia */
.audience-tab-btn.active {
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 0 16px rgba(39, 102, 164, 0.5);
}

.mode-citizen-pill {
  background: rgba(82, 183, 136, 0.15);
  border: 1px solid rgba(82, 183, 136, 0.4);
  color: #74c69d;
}

.mode-researcher-pill {
  background: rgba(157, 78, 221, 0.15);
  border: 1px solid rgba(157, 78, 221, 0.4);
  color: #c77dff;
}

/* Cajas de conceptos pegajosos y metáforas */
.sticky-concept-box {
  background: linear-gradient(135deg, rgba(196, 174, 143, 0.12) 0%, rgba(16, 45, 70, 0.85) 100%);
  border-left: 3px solid var(--sand);
  border-radius: 0 10px 10px 0;
}

.researcher-box {
  font-family: Consolas, 'Courier New', monospace;
  background: rgba(8, 24, 40, 0.92);
  border: 1px solid rgba(39, 102, 164, 0.4);
  color: #dceaf3;
}

/* Indicador de SLA de Calidad */
.sla-badge {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(82, 183, 136, 0.12);
  border: 1px solid rgba(82, 183, 136, 0.35);
  color: #74c69d;
}
