/* ===== ORGANIZATIONAL CHART MODAL COMPONENT ===== */
/* Organigrama empresarial súper PRO con efectos y estilo TypingSoft */

/* Modal Overlay */
.org-chart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.org-chart-modal.active {
  opacity: 1;
  visibility: visible;
}

.org-chart-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: radial-gradient(circle at center,
      rgba(0, 0, 161, 0.15) 0%,
      rgba(42, 208, 208, 0.08) 30%,
      rgba(0, 0, 0, 0.9) 100%);
}

/* Modal Content */
.org-chart-modal-content {
  position: relative;
  width: 90%;
  max-width: 1300px;
  max-height: 10vh;
  background: linear-gradient(145deg,
      rgba(0, 0, 161, 0.12),
      rgba(42, 208, 208, 0.06),
      rgba(19, 95, 148, 0.1));
  border: 3px solid;
  border-image: linear-gradient(45deg,
      #2AD0D0 0%,
      #0000A1 50%,
      #135F94 100%) 1;
  border-radius: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: blur(30px);
  box-shadow:
    0 35px 70px rgba(0, 0, 161, 0.4),
    0 20px 40px rgba(42, 208, 208, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: scale(0.7) translateY(100px);
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
}

.org-chart-modal.active .org-chart-modal-content {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.org-chart-modal-header {
  padding: 25px 40px;
  background: linear-gradient(135deg,
      rgba(0, 0, 161, 0.2),
      rgba(42, 208, 208, 0.1));
  border-bottom: 2px solid rgba(42, 208, 208, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  flex-shrink: 0;
}

.org-chart-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      #2AD0D0 50%,
      transparent 100%);
}

.org-chart-title {
  font-family: 'Orbitron', monospace;
  font-size: 26px;
  font-weight: 900;
  color: #2AD0D0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 25px rgba(42, 208, 208, 0.7);
}

.org-icon {
  font-size: 32px;
  animation: buildingPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(42, 208, 208, 0.8));
}

@keyframes buildingPulse {

  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 20px rgba(42, 208, 208, 0.8));
  }

  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 30px rgba(42, 208, 208, 1));
  }
}

.org-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  font-family: 'Rajdhani', sans-serif;
  margin-left: 10px;
  display: block;
  margin-top: 5px;
}

.org-chart-close-btn {
  background: linear-gradient(145deg, #0000A1, #135F94);
  border: 2px solid rgba(42, 208, 208, 0.3);
  color: #2AD0D0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 161, 0.4);
}

.org-chart-close-btn:hover {
  background: linear-gradient(145deg, #135F94, #2AD0D0);
  color: #000;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 10px 30px rgba(42, 208, 208, 0.6);
}

/* Organizational Chart Container */
.org-chart-container {
  position: relative;
  padding: 30px 25px;
  overflow: visible;
  min-height: 400px;
  flex: 1;
}

/* Organization Levels - Ajustado para 100% zoom */
.org-level {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 35px;
  position: relative;
}

.ceo-level {
  margin-bottom: 50px;
}

.department-level {
  margin-bottom: 50px;
}

.specialists-level {
  margin-bottom: 20px;
}

.departments-container {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 1000px;
  gap: 30px;
  flex-wrap: wrap;
}

.specialists-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  gap: 40px;
  flex-wrap: wrap;
}

/* Organization Cards */
.org-card {
  position: relative;
  background: linear-gradient(145deg,
      rgba(0, 0, 161, 0.15),
      rgba(42, 208, 208, 0.08));
  border: 2px solid rgba(42, 208, 208, 0.3);
  border-radius: 20px;
  padding: 20px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(15px);
  overflow: hidden;
  transform: translateY(30px);
  opacity: 0;
}

.org-chart-modal.active .org-card {
  animation: orgCardSlideUp 1s ease-out forwards;
}

/* Staggered animations */
.org-chart-modal.active .ceo-card {
  animation-delay: 0.2s;
}

.org-chart-modal.active .department-card:nth-child(1) {
  animation-delay: 0.4s;
}

.org-chart-modal.active .department-card:nth-child(2) {
  animation-delay: 0.5s;
}

.org-chart-modal.active .department-card:nth-child(3) {
  animation-delay: 0.6s;
}

.org-chart-modal.active .specialist-card:nth-child(1) {
  animation-delay: 0.8s;
}

.org-chart-modal.active .specialist-card:nth-child(2) {
  animation-delay: 0.9s;
}

.org-chart-modal.active .specialist-card:nth-child(3) {
  animation-delay: 1.0s;
}

@keyframes orgCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.org-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: rgba(42, 208, 208, 0.6);
  box-shadow:
    0 25px 50px rgba(0, 0, 161, 0.3),
    0 15px 30px rgba(42, 208, 208, 0.2);
}

/* Card Glow Effect */
.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(42, 208, 208, 0.15) 0%,
      transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

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

/* Card Sizes - Optimizado para 100% zoom */
.ceo-card {
  width: 280px;
  min-height: 170px;
  border: 3px solid rgba(42, 208, 208, 0.4);
}

.department-card {
  width: 240px;
  min-height: 150px;
}

.specialist-card {
  width: 200px;
  min-height: 130px;
}

/* Position Avatars */
.position-avatar {
  position: relative;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-image {
  border-radius: 50%;
  border: 3px solid rgba(42, 208, 208, 0.4);
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 161, 0.3);
}

.ceo-card .avatar-image {
  width: 80px;
  height: 80px;
}

.department-card .avatar-image {
  width: 70px;
  height: 70px;
}

.specialist-card .avatar-image {
  width: 60px;
  height: 60px;
}

.org-card:hover .avatar-image {
  border-color: rgba(42, 208, 208, 0.8);
  box-shadow: 0 12px 30px rgba(42, 208, 208, 0.4);
  transform: scale(1.05);
}

/* Avatar Decorations */
.avatar-crown {
  position: absolute;
  top: -10px;
  right: -5px;
  font-size: 20px;
  animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-5px);
  }
}

.department-icon,
.specialist-icon {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: linear-gradient(135deg, #0000A1, #135F94);
  border: 2px solid rgba(42, 208, 208, 0.4);
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Position Information */
.position-info {
  color: white;
}

.position-name {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #2AD0D0;
  margin: 0 0 5px;
  text-shadow: 0 0 15px rgba(42, 208, 208, 0.6);
}

.ceo-card .position-name {
  font-size: 18px;
}

.position-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ceo-card .position-title {
  font-size: 15px;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.position-description {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
  margin: 0 0 12px;
  font-family: 'Rajdhani', sans-serif;
}

/* Position Skills */
.position-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 10px;
}

.skill-badge {
  background: linear-gradient(135deg, #135F94, #2AD0D0);
  color: #000;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: 'Rajdhani', sans-serif;
  transition: all 0.3s ease;
}

.skill-badge:hover {
  background: linear-gradient(135deg, #2AD0D0, #135F94);
  transform: scale(1.05);
}

.ceo-card .skill-badge {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
}

/* Connection Lines (will be enhanced with SVG) */
.connection-line {
  position: absolute;
  bottom: -20px;
  left: 50%;
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(42, 208, 208, 0.8), transparent);
  transform: translateX(-50%);
}

/* SVG Connections - ELIMINADO - Las líneas tapaban las tarjetas */

/* Org Chart Footer - Eliminado para mejor aprovechamiento del espacio */

/* Responsive Design */

/* Pantallas muy grandes (monitores de escritorio) */
@media (min-width: 1600px) {
  .org-chart-modal-content {
    width: 85%;
    max-width: 1400px;
    max-height: 85vh;
  }

  .org-chart-container {
    padding: 40px 35px;
  }

  .ceo-card {
    width: 320px;
    min-height: 180px;
  }

  .department-card {
    width: 280px;
    min-height: 160px;
  }

  .specialist-card {
    width: 240px;
    min-height: 140px;
  }

  .departments-container {
    max-width: 1100px;
    gap: 40px;
  }

  .specialists-container {
    gap: 50px;
    max-width: 1000px;
  }
}

/* Laptops y pantallas medianas - Optimizado para 100% zoom */
@media (max-width: 1440px) {
  .org-chart-modal-content {
    width: 88%;
    max-width: 1200px;
    max-height: 90vh;
  }

  .org-chart-modal-header {
    padding: 22px 35px;
  }

  .org-chart-title {
    font-size: 24px;
  }

  .org-chart-container {
    padding: 35px 25px;
    min-height: 400px;
  }

  .departments-container {
    max-width: 900px;
    gap: 25px;
  }

  .specialists-container {
    gap: 30px;
    max-width: 800px;
  }

  .ceo-level {
    margin-bottom: 45px;
  }

  .department-level {
    margin-bottom: 45px;
  }

  .specialists-level {
    margin-bottom: 25px;
  }
}

/* Tablets y laptops pequeñas */
@media (max-width: 1200px) {
  .org-chart-modal-content {
    width: 90%;
    max-height: 90vh;
  }

  .departments-container {
    flex-direction: column;
    align-items: center;
    gap: 25px;
    max-width: 100%;
  }

  .specialists-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
  }

  .org-chart-title {
    font-size: 20px;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .org-chart-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .org-chart-container {
    padding: 20px 15px;
  }

  .departments-container {
    gap: 20px;
  }

  .specialists-container {
    gap: 20px;
  }


}

/* Móviles grandes */
@media (max-width: 768px) {
  .org-chart-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .org-chart-modal-header {
    padding: 20px 20px;
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .org-chart-title {
    font-size: 18px;
    flex-direction: column;
    gap: 5px;
  }

  .org-chart-container {
    padding: 20px 15px;
  }

  .departments-container {
    gap: 20px;
  }

  .specialists-container {
    gap: 20px;
  }

  .ceo-card,
  .department-card,
  .specialist-card {
    width: 100%;
    max-width: 280px;
  }


}

/* Móviles pequeños */
@media (max-width: 480px) {
  .org-chart-modal-content {
    width: 98%;
    border-radius: 15px;
  }

  .org-chart-container {
    padding: 15px 10px;
  }

  .org-chart-modal-header {
    padding: 15px;
  }

  .org-chart-title {
    font-size: 16px;
  }

  .ceo-card,
  .department-card,
  .specialist-card {
    max-width: 100%;
  }
}

/* Extra pequeños */
@media (max-width: 360px) {
  .org-chart-modal-content {
    width: 100%;
    max-height: 98vh;
    border-radius: 10px;
    margin: 0;
  }

  .org-chart-container {
    padding: 10px 8px;
  }

  .org-chart-modal-header {
    padding: 12px;
  }
}

/* Ajustes específicos de tarjetas por pantalla */
@media (max-width: 1440px) {
  .ceo-card {
    width: 260px;
    min-height: 155px;
  }

  .department-card {
    width: 220px;
    min-height: 135px;
  }

  .specialist-card {
    width: 180px;
    min-height: 115px;
  }

  /* Ajuste de líneas para laptops */
  .org-connections {
    top: 5px;
  }
}

/* Líneas eliminadas - ya no son necesarias */

@media (min-width: 769px) and (max-width: 1200px) {
  /* Líneas eliminadas - código limpio */
}

@media (max-width: 1200px) {
  .ceo-card {
    width: 280px;
    min-height: 150px;
  }

  .department-card {
    width: 240px;
    min-height: 130px;
  }

  .specialist-card {
    width: 200px;
    min-height: 110px;
  }
}

@media (max-width: 1024px) {
  .ceo-card {
    width: 260px;
    min-height: 140px;
  }

  .department-card {
    width: 220px;
    min-height: 120px;
  }

  .specialist-card {
    width: 180px;
    min-height: 100px;
  }
}

@media (max-width: 768px) {
  .ceo-card {
    width: 100%;
    max-width: 280px;
    min-height: 140px;
  }

  .department-card {
    width: 100%;
    max-width: 260px;
    min-height: 130px;
  }

  .specialist-card {
    width: 100%;
    max-width: 240px;
    min-height: 120px;
  }
}

@media (max-width: 480px) {
  .ceo-card {
    width: 100%;
    max-width: 320px;
    min-height: 130px;
  }

  .department-card {
    width: 100%;
    max-width: 300px;
    min-height: 120px;
  }

  .specialist-card {
    width: 100%;
    max-width: 280px;
    min-height: 110px;
  }

  .org-card {
    padding: 15px 12px;
  }
}

/* Ajustes de padding por pantalla */
@media (max-width: 1440px) and (max-height: 900px) {
  .org-card {
    padding: 18px 14px;
  }
}

@media (max-width: 1024px) {
  .org-card {
    padding: 20px 16px;
  }
}

@media (max-width: 768px) {
  .org-card {
    padding: 18px 15px;
  }
}

@media (max-width: 360px) {
  .org-card {
    padding: 12px 10px;
  }
}

/* SVG Connections - ELIMINADO COMPLETAMENTE - Tapaban las tarjetas */
/* Mejorar el scrolling en móviles */
@media (max-width: 768px) {
  .org-chart-modal-content {
    -webkit-overflow-scrolling: touch;
  }

  .org-chart-container {
    overflow: visible;
    padding: 20px 15px;
  }
}

/* Optimizaciones para pantallas muy pequeñas */
@media (max-width: 480px) {
  .org-chart-modal {
    padding: 10px;
    align-items: flex-start;
    padding-top: 20px;
  }

  .org-chart-modal-content {
    border-radius: 12px;
    min-height: auto;
  }
}

/* Special Effects */
@keyframes orgChartEntrance {
  0% {
    opacity: 0;
    transform: scale(0.8) rotateX(-15deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotateX(0deg);
  }
}

.org-chart-modal.active .org-chart-container {
  animation: orgChartEntrance 1s ease-out 0.3s both;
}

/* CEO Special Effects */
.ceo-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #FFD700, #2AD0D0, #FFD700);
  border-radius: 20px;
  z-index: -1;
  opacity: 0.7;
  animation: ceoGlow 3s linear infinite;
}

@keyframes ceoGlow {

  0%,
  100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }
}

/* ===== PERSON PROFILE MODAL ===== */
.person-profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(15px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.profile-content {
  position: relative;
  background: linear-gradient(145deg,
      rgba(0, 0, 161, 0.9),
      rgba(42, 208, 208, 0.1),
      rgba(19, 95, 148, 0.8));
  border: 2px solid rgba(42, 208, 208, 0.4);
  border-radius: 20px;
  padding: 0;
  min-width: 400px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow:
    0 20px 50px rgba(0, 0, 161, 0.4),
    0 10px 25px rgba(42, 208, 208, 0.3);
  backdrop-filter: blur(20px);
}

.profile-header {
  background: linear-gradient(135deg, #0000A1, #135F94);
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(42, 208, 208, 0.3);
  border-radius: 20px 20px 0 0;
}

.profile-header h3 {
  color: #2AD0D0;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 15px rgba(42, 208, 208, 0.6);
}

.profile-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(42, 208, 208, 0.3);
  color: #2AD0D0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-close:hover {
  background: rgba(42, 208, 208, 0.2);
  transform: rotate(90deg) scale(1.1);
}

.profile-body {
  padding: 25px;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Rajdhani', sans-serif;
}

.profile-info {
  margin-bottom: 20px;
}

.profile-info p {
  margin: 0 0 12px 0;
  font-size: 15px;
  line-height: 1.5;
}

.profile-info strong {
  color: #2AD0D0;
  font-weight: 600;
}

.profile-specialties {
  margin-bottom: 20px;
}

.profile-specialties strong {
  color: #2AD0D0;
  font-size: 15px;
  font-weight: 600;
}

.specialties-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.specialty-tag {
  background: linear-gradient(135deg, #135F94, #2AD0D0);
  color: #000;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.specialty-tag:hover {
  background: linear-gradient(135deg, #2AD0D0, #135F94);
  transform: scale(1.05);
}

.profile-achievements strong {
  color: #2AD0D0;
  font-size: 15px;
  font-weight: 600;
}

.achievements-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
}

.achievements-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(42, 208, 208, 0.1);
  font-size: 14px;
  position: relative;
  padding-left: 20px;
}

.achievements-list li:before {
  content: '🏆';
  position: absolute;
  left: 0;
  top: 8px;
}

.achievements-list li:last-child {
  border-bottom: none;
}

/* Efectos especiales para partículas */
.org-particle {
  animation: particleFloat 1.5s ease-out forwards;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }

  100% {
    opacity: 0;
    transform: scale(0.3) rotate(360deg) translateY(-60px);
  }
}