/* styles.css */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #f8f9fa;
  overflow: auto;
  font-family: Arial, sans-serif;
}

/* Título pequeño y centrado */
#main-title {
  font-size: 0.8em;
  text-align: center;
  margin: 10px 0;
}

/* Contenedor global: ocupa el 100% del viewport */
#main-content {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Contenedor del árbol: ocupa el 100% del espacio disponible */
#tree-wrapper {
  width: 100%;
  height: calc(100% - 40px); /* Dejamos espacio para el título */
  overflow-x: auto; /* Permitimos scroll horizontal */
  overflow-y: auto;
  position: relative;
  background-color: #f8f9fa;
  padding: 10px;
  box-sizing: border-box;
}

/* Contenedor para centrar y escalar el árbol; se posiciona a la izquierda */
#tree-scale-container {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

/* Estilo base para cada tarjeta */
.person {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  border: 1px solid black;
  margin: 5px;
}

/* Tarjetas fijas con padding interno y bordes redondeados */
.person.card {
  width: 286px !important;
  height: 420px !important;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 10px;
}

.person:hover {
  transform: scale(1.05);
}

/* Adaptar textos en móviles */
@media (max-width: 768px) {
  .person .card-body, .person .info {
    font-size: 14px;
  }
}

/* Redondear imágenes */
.person img {
  border-radius: 50% !important;
}

/* Borde dorado para el usuario con ID 502 */
.highlight-user {
  border: 3px solid rgb(15, 61, 211) !important;
}

/* Líneas de conexión */
.branch {
  stroke: #5D4037;  /* Marrón oscuro */
  stroke-width: 2;
  fill: none;
}

.spouse-link {
  stroke: red;
  stroke-width: 4;
  fill: none;
}

.related-link {
  stroke: #4E342E;  /* Marrón muy oscuro */
  stroke-width: 4;
  fill: none;
}

/* SVG para conexiones */
#tree-svg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

/* Popup de bienvenida */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup {
  width: 75vw;
  max-width: 600px;
  text-align: center;
  border: 2px solid #b8860b;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  background: linear-gradient(135deg, #fff, #f3f1e7);
  padding: 1.5rem;
  border-radius: 8px;
}

/* Responsivo */
@media (max-width: 768px) {
  #tree-wrapper {
    padding: 10px;
  }
}
