/* Variables globales */
:root {
  --primary-font: "Libre Baskerville", sans-serif;
  --text-color: rgba(0, 0, 0, 0.85);
  --accent-color: #ffffff;
  --transition: all 0.3s ease;
  --background-color: #ffffff;
}

/* Reset y estilos base */
body {
  font-family: var(--primary-font);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  line-height: 1.6;
}

header {
  background: linear-gradient(180deg, #000000 50%, var(--background-color) 100%);
  padding: 60px 20px;
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  color: var(--accent-color);
  font-size: clamp(24px, 5vw, 36px);
  margin-bottom: 15px;
}

#subtitulo {
  font-size: clamp(16px, 2.5vw, 18px);
  font-style: italic;
  color: var(--accent-color);
  margin: 0;
  padding-top: 40px;
}

/* Layout */
main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Tipografía */
h1 {
  font-size: clamp(24px, 5vw, 36px);
  color: var(--accent-color);
  margin-bottom: 10px;
}

h2 {
  font-size: clamp(20px, 4vw, 24px);
  margin: 20px 0;
}

p {
  font-size: clamp(16px, 2.5vw, 18px);
  line-height: 1.8;
  color: var(--text-color);
}

/* Componentes */
.cita {
  font-family: var(--primary-font);
  border-left: 1px solid grey;
  padding-left: 15px;
  margin: 20px 0;
  font-size: clamp(16px, 2.5vw, 18px);
  line-height: 1.8;
}

.advertencia {
  font-family: var(--primary-font);
  font-style: italic;
  font-size: 0.9em;
  border-top: 1px solid grey;
  border-bottom: 1px solid grey;
  padding: 10px 0;
  margin: 20px 0;
}

/* Gráficos y visualizaciones */
.grafico-container {
  width: 100%;
  overflow: hidden;
  margin: 20px 0;
}

svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Elementos interactivos */
.tooltip {
  position: absolute;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

/* Marcadores de texto */
mark {
  background-color: transparent;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 50%, #79b7b4 50%);
  background-size: 200% auto;
  background-position: 0% 0;
  transition: background-position 1s cubic-bezier(1, 0, 0.2, 1);
}

mark.active {
  background-position: -99.99% 0;
}

mark.amarillo {
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 50%, #ede574 50%);
}

mark.lila {
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 50%, rgba(143, 86, 141, 0.8) 50%);
}

/* Media Queries */
@media screen and (min-width: 1200px) {
  main {
    padding: 0 max(20px, calc((100% - 1200px) / 2));
  }
}

@media screen and (max-width: 768px) {
  main {
    padding: 0 15px;
  }
  
  .cita {
    margin-left: 0;
    margin-right: 0;
  }
}

@media screen and (max-width: 576px) {
  main {
    padding: 0 10px;
  }
}

/*Estilos para el dendeograma principal :)*/

.node-primary {
  fill: #ffffff;
  filter: url(#glow);
  cursor: pointer;
  transition: all 0.3s ease;
}

.node-primary:hover {
  fill: #ffffff;
}

.node-secondary {
  fill: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  fill-opacity: 0.5;
  transition: all 0.3s ease;
}

.node-secondary:hover {
  fill: #ffffff;
}

.link {
  fill: none;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.5px;
  transition: all 0.3s ease;
}

.link.highlighted {
  stroke: #ffffff;
  stroke-opacity: 1;
  stroke-width: 2px;
}
.arc-segment {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5px;
  filter: url(#glow);
}

.link {
  fill: none;
  stroke: #333;
  stroke-width: 1px;
  stroke-opacity: 0.4;
  transition: all 0.3s ease;
}

.link.highlighted {
  stroke: #ff0000;
  stroke-opacity: 0.6;
  stroke-width: 1.5px;
}

.node-primary {
  fill: #ff0000;
  cursor: pointer;
  transition: all 0.3s ease;
}

.node-primary:hover {
  fill: #ff3333;
}

.node-secondary {
  fill: rgba(255, 255, 255, 0.15);
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.node-secondary:hover {
  fill: rgba(255, 255, 255, 0.25);
  stroke: #fff;
}

.node-label {
  font-family: 'Arial', sans-serif;
  font-size: 12px;
  fill: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.node:hover .node-label {
  opacity: 1;
}

section.black {
  width: 100vw !important;
  min-height: 100vh !important;
  background-color: #000000 !important;
  align-content :center;
  margin: 0;
  padding: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  color: rgba(255, 255, 255, 0.9) !important; /* Color base para todo el texto */
}

/* Estilos específicos para los elementos dentro de section.black */
section.black h3 {
  color: rgba(255, 255, 255, 0.9) !important;
  font-family: var(--primary-font) !important;
  margin: 60px 0 20px 0 !important; 
  padding: 0 20px !important;
  font-size: clamp(16px, 4vw, 24px) !important; /* Aumentado el tamaño mínimo */
}

section.black section {
  margin: 40px 0 !important;
  padding: 0 20px !important;
}

/* Estilos para texto y elementos dentro de los gráficos */
section.black text,
section.black .tick text,
section.black .axis-label,
section.black .legend-text {
  fill: rgba(255, 255, 255, 0.8) !important;
}

section.black .domain,
section.black .tick line {
  stroke: rgba(255, 255, 255, 0.2) !important;
}

/* Gradiente superior */
section.black::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 50px !important;
  background: linear-gradient(to top, #000000, #ffffff) !important;
}

/* Gradiente inferior */
section.black::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 50px !important;
  background: linear-gradient(to bottom, #000000, #ffffff) !important;
}
/* Media queries para dispositivos muy pequeños */
@media screen and (max-width: 480px) {
  section.black h3 {
    font-size: clamp(18px, 4vw, 24px) !important;
  }
}

/*Estilos nube de palabras*/

#chart_dan {
  width: 100%;
  height: 80vh;
}

.line {
  transition: stroke-opacity 0.2s;
}

.bubble-group:hover circle {
  filter: brightness(95%);
}

.bubble-group:hover .line {
  stroke-opacity: 0.8 !important;
  stroke-width: 2px;
}

.axis-label {
  font-family: Arial, sans-serif;
  font-size: 12px;
  fill: rgba(255, 255, 255, 0.4);
}
.bar-label {
  font-family: Arial, sans-serif;
  font-size: 10px;
  fill: darkorange;
}
.legend-text {
  font-family: Arial, sans-serif;
  font-size: 12px;
  fill: rgba(255, 255, 255, 0.8);
}
.domain {
  stroke: rgba(255, 255, 255, 0.1);
}
.tick line {
  stroke: rgba(255, 255, 255, 0.1);
}
.tick text {
  fill: rgba(255, 255, 255, 0.4);
}

methodology-section {
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
}
h1, h2 {
  color: #2c3e50;
}
.step {
  margin-bottom: 15px;
  padding-left: 20px;
}
.metric {
  background-color: #f7f9fc;
  padding: 10px;
  margin: 5px 0;
  border-radius: 3px;
}