/* =========================================
   WRAPPER Y CONTENEDOR PRINCIPAL
   ========================================= */
#org-wrapper {
  overflow: auto;
  cursor: grab;
  scrollbar-width: thin;
  padding-bottom: 60px;
}

.org-tree {
  display: inline-block;
  transform-origin: top center;
  transition: transform 0.2s ease-out;
}

/* =========================================
   ESTRUCTURA DEL ÁRBOL
   ========================================= */
.org-tree ul {
  padding-top: 20px;
  position: relative;
  display: flex;
  justify-content: center;
  padding-left: 0;
}

.org-tree li {
  list-style: none;
  text-align: center;
  position: relative;
  padding: 20px 10px 0;
}

/* Líneas horizontales */
.org-tree li::before,
.org-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  border-top: 2px solid #ccc;
  width: 50%;
  height: 20px;
}

.org-tree li::before {
  right: 50%;
}

.org-tree li::after {
  left: 50%;
  border-left: 2px solid #ccc;
}

/* Línea vertical hacia hijos */
.org-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid #ccc;
  height: 20px;
}

/* Correcciones de bordes */
.org-tree li:first-child::before {
  border: none;
}

.org-tree li:last-child::after {
  border: none;
}

.org-tree li:only-child::before,
.org-tree li:only-child::after {
  display: none;
}

/* =========================================
   TARJETAS
   ========================================= */
.org-card {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 15px;
  width: 150px;
  min-height: 130px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: .3s;
  z-index: 2;
}

.org-card img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.org-card span {
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: center;
}

/* Hover general */
.org-card:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 15px rgba(0,0,0,0.12);
}

/* =========================================
   EFECTO FOCO (PRO)
   ========================================= */
.org-tree:hover .org-card {
  opacity: 0.4;
}

.org-card:hover {
  opacity: 1 !important;
  transform: translateY(-5px) scale(1.1);
  z-index: 20;
}

/* =========================================
   COLORES POR ÁREA
   ========================================= */
.area-liderazgo { border-top: 4px solid #3F51B5; }
.area-liderazgo span { color: #303F9F; font-weight: 600; }

.area-pedagogica { border-top: 4px solid #009688; }
.area-pedagogica span { color: #00796B; font-weight: 600; }

.area-apoyo { border-top: 4px solid #9C27B0; }
.area-apoyo span { color: #7B1FA2; }

/* =========================================
   ESTUDIANTES DESTACADO
   ========================================= */
.area-estudiantes {
  border: none;
  background: linear-gradient(135deg, #FFB300, #FF8F00);
  box-shadow: 0 8px 20px rgba(255,143,0,0.4);
  transform: scale(1.15);
  z-index: 5;
}

.area-estudiantes img {
  border: 3px solid #fff;
}

.area-estudiantes span {
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

.area-estudiantes:hover {
  transform: translateY(-5px) scale(1.2);
}

/* =========================================
   TOOLTIP MEJORADO
   ========================================= */
.org-card::after {
  content: attr(data-info);
  position: absolute;
  bottom: -65px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: .75rem;
  opacity: 0;
  transition: .3s;
  max-width: 160px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
}

.org-card:hover::after {
  opacity: 1;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .org-tree ul {
    flex-direction: column;
    align-items: center;
  }

  .org-tree li {
    padding-top: 15px;
  }

  .org-tree li::before,
  .org-tree li::after,
  .org-tree ul ul::before {
    display: none;
  }

  .area-estudiantes {
    transform: scale(1.05);
  }

  .area-estudiantes:hover {
    transform: translateY(-3px) scale(1.08);
  }
}

@media (max-width: 768px) {

  .org-tree {
    transform: none !important;
  }

  .org-tree ul {
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
  }

  .org-tree li {
    padding: 10px 0;
  }

  /* Eliminar líneas */
  .org-tree li::before,
  .org-tree li::after,
  .org-tree ul ul::before {
    display: none;
  }

  /* Indentación visual */
  .org-tree ul ul {
    padding-left: 20px;
    border-left: 2px dashed #ccc;
  }

  .org-card {
    width: 100%;
    max-width: 280px;
  }
}