/* ==========================================================================
   Research Hub — Rediseño Front-End
   Variables globales de color y tipografía (paleta oficial de marca)
   ========================================================================== */

:root {
  /* Marca — paleta oficial */
  --color-navy-950: #12013f;
  --color-navy-900: #190356;
  --color-navy-800: #2b1470;
  --color-red-600: #d90921;
  --color-red-700: #b8071c;
  --color-red-800: #8f0516;
  --color-grey-400: #4d4d4d;
  --color-grey-200: #dfdfdf;
  

  /* Neutrales */
  --color-white: #ffffff;
  --color-bg: #f2f2f5;
  --color-bg-alt: #eceef2;
  --color-border: #e1e2e8;
  --color-text: #1a1a2e;
  --color-text-muted: #55566b;

  /* Iconos de estadísticas (paleta oficial) */
  --stat-blue: #4e8bf2;
  --stat-teal: #22b5a5;
  --stat-pink: #f27482;
  --stat-purple: #5147b8;
  --stat-lavender: #a090d6;
  --stat-plum: #8B3FA6;
  --stat-sky: #38b6e8;

  /* Tipografía */
  --font-base: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 10px rgba(23, 12, 58, 0.08);
  --shadow-card-hover: 0 6px 20px rgba(23, 12, 58, 0.14);
  --container-max: 1280px;
  --container-max-wide: 1600px;
}

/* ==========================================================================
   Reset básico
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  background-image: url('../images/Banner_home.webp');
  color: var(--color-white);
  padding: 56px 24px 64px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.05) 0, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.06) 0, transparent 45%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: var(--container-max);
  margin-inline: auto;
}

.hero__title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  margin: 0 0 40px;
  line-height: 1.15;
  color: white;
}

.hero__title span {
  font-weight: 500;
  color: white;
}

/* Buscador */

.hero__search {
  display: flex;
  gap: 12px;
  max-width: 880px;
  margin: 0 auto 12px;
  background: var(--color-white);
  padding: 6px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.hero__search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: 1rem;
  border-radius: var(--radius-md);
  color: var(--color-text);
  min-width: 0;
}

.hero__search button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-red-600);
  color: var(--color-white);
  border: none;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.hero__search button:hover {
  background: var(--color-red-700);
}

.hero__search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hero__advanced {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 880px;
  margin: 0 auto 32px;
  color: var(--color-white);
  opacity: 0.9;
  font-size: 0.95rem;
  background: none;
  border: none;
  padding-left: 8px;
}

/* Tarjetas de procesos: Docencia / Investigación / Extensión */

.hero__processes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  background: rgba(25, 3, 86);  /* #190356 con ~15% opacidad (sutil) */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  justify-items: center;
}

.process-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.process-card:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -86px;
  top: 50%;
  transform: translateY(-50%);
  height: 100%;
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.process-card__icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-red-600);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--color-navy-900), 0 0 0 6px rgba(255, 255, 255, 0.9);
}

.process-card__icon svg,
.process-card__icon img {
  width: 26px;
  height: 26px;
  stroke: var(--color-white);
  fill: none;
}

.process-card__title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
}

.process-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  opacity: 0.85;
  color: white;
}

.process-card__arrow {
  color: #ffc72c;
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1;
}

/* ==========================================================================
   Estadísticas
   ========================================================================== */

.stats {
  background: var(--color-white);
  padding: 32px 24px 40px;
}

.stats__grid {
  max-width: var(--container-max-wide);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  justify-items: center;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 0 8px;
}

.stat-card:not(:first-child)::before {
  content: "";
  display: none; /* solo cuando las 5 columnas caben en una fila; ver responsive.css */
  position: absolute;
  left: -8px;
  top: -5px;
  height: 122px;
  width: 1px;
  background: var(--color-border);
}

.stat-card__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: 4px 12px 4px 4px;
}

.stat-card__icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card__icon svg,
.stat-card__icon img {
  width: 28px;
  height: 28px;
  stroke: var(--color-white);
  fill: none;
}

.stat-card--blue .stat-card__icon { background: var(--stat-blue); }
.stat-card--blue .stat-card__pill { border-color: var(--stat-blue); }

.stat-card--teal .stat-card__icon { background: var(--stat-teal); }
.stat-card--teal .stat-card__pill { border-color: var(--stat-teal); }

.stat-card--pink .stat-card__icon { background: var(--stat-pink); }
.stat-card--pink .stat-card__pill { border-color: var(--stat-pink); }

.stat-card--purple .stat-card__icon { background: var(--stat-purple); }
.stat-card--purple .stat-card__pill { border-color: var(--stat-purple); }

.stat-card--lavender .stat-card__icon { background: var(--stat-lavender); }
.stat-card--lavender .stat-card__pill { border-color: var(--stat-lavender); }

.stat-card--Plum .stat-card__icon { background: var(--stat-plum); }
.stat-card--Plum .stat-card__pill { border-color: var(--stat-plum); }

.stat-card--sky .stat-card__icon { background: var(--stat-sky); }
.stat-card--sky .stat-card__pill { border-color: var(--stat-sky); }

.stat-card__value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
  white-space: nowrap;
}

.stat-card__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  max-width: 160px;
}

/* ==========================================================================
   Sección: Encuentre + Mapa de colaboración
   ========================================================================== */

.discover {
  padding: 8px 24px 64px;
}

.discover__grid {
  max-width: var(--container-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

/* Panel "Encuentre" */

.finder {
  background: var(--color-grey-400);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  color: var(--color-white);
}

.finder__title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 20px;
}

.finder__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finder__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-white);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.finder__link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.finder__link svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-red-600);
  fill: none;
  flex-shrink: 0;
}

/* Formulario buscador dentro del finder (Tutor para tesis) */
.finder__form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-grey-200);
  border-radius: var(--radius-md);
  padding: 8px 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin: 0;
}

.finder__form:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.finder__autocomplete {
  flex: 1;
  position: relative;
}

.finder__search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 8px 0;
  font-family: var(--font-base);
}

.finder__search-input::placeholder {
  color: var(--color-text);
  font-weight: 300;
  opacity: 1;
}

.finder__search-btn {
  width: 33px;
  height: 33px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #d50032;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
/*   background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 0 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0; */
}

.finder__search-btn svg {
  width: 18px;
  height: 18px;
  /* stroke: var(--color-red-600); */
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.8;
}

/* Posicionar el dropdown de autocomplete VIVO */
.finder__autocomplete .js-autocomplete-hints {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
}

/* Tarjeta del mapa */

.map-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  min-width: 0;
}

.map-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.map-card__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.map-card__subtitle {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.map-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.map-toggle.is-active {
  background: var(--color-red-600);
  border-color: var(--color-red-600);
  color: var(--color-white);
}

.map-toggle--full {
  background: var(--color-red-600);
  color: var(--color-white);
  border-color: var(--color-red-600);
}

#network-map-container {
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #eef1f6;
}

.map-search {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  display: flex;
  gap: 6px;
}

.map-search input {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  width: 200px;
  box-shadow: var(--shadow-card);
}

.map-search button {
  background: var(--color-red-600);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  box-shadow: var(--shadow-card);
}

.map-card__legend {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.map-card__legend-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.legend-items li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

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

/* Marcador de sede propia (Bogotá) dentro del mapa Leaflet */

.home-marker__pin {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  background: var(--color-navy-900);
  border: 2px solid var(--color-white);
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Placeholder genérico para piezas gráficas pendientes */

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg,
      var(--color-bg-alt),
      var(--color-bg-alt) 10px,
      #e4e5eb 10px,
      #e4e5eb 20px);
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}