/* --- Variables de Configuración --- */

:root {
  --card-width: 320px;
  --card-height: 480px;
  --card-gap: 30px;
  --glass-bg: rgba(20, 25, 35, 0.45);
  --glass-border: rgba(255, 255, 255, 0.15);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --accent-color: #4a90e2;
}

/* --- Sección Principal --- */

.team-section {
  position: relative;
  width: 100%;
  min-height: 700px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  padding: 40px 0;
}

/* --- Contenedor del Carrusel --- */

.carousel-viewport {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: var(--card-height);
  perspective: 1200px;
}

/* --- Track del Carrusel --- */

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* --- Estilos de la Card --- */

.team-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--card-width);
  height: var(--card-height);
  margin-left: calc(var(--card-width) / -2);
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
  transform-style: preserve-3d;
}

/* Posiciones del Carrusel (Cíclico) */

.pos-center {
  transform: translateX(0) scale(1);
  opacity: 1;
  filter: blur(0);
  z-index: 10;
}

.pos-right-1 {
  transform: translateX(calc(100% + var(--card-gap))) scale(0.85);
  opacity: 0.7;
  filter: blur(2px);
  z-index: 5;
}

.pos-right-2 {
  transform: translateX(calc(200% + (var(--card-gap) * 2))) scale(0.7);
  opacity: 0.4;
  filter: blur(4px);
  z-index: 2;
}

.pos-left-1 {
  transform: translateX(calc(-100% - var(--card-gap))) scale(0.85);
  opacity: 0.7;
  filter: blur(2px);
  z-index: 5;
}

.pos-left-2 {
  transform: translateX(calc(-200% - (var(--card-gap) * 2))) scale(0.7);
  opacity: 0.4;
  filter: blur(4px);
  z-index: 2;
}

.pos-hidden {
  transform: translateX(0) scale(0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

/* --- Efecto Flip 3D --- */

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.team-card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* Caras de la Card */

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 30px;
}

/* --- Parte Superior (Imagen) --- */

.card-image {
  width: 100%;
  height: 55%;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--glass-border);
}

/* --- Parte Inferior (Efecto Cristal) --- */

.card-glass-info {
  position: relative;
  height: 45%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card-glass-info h3 {
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  letter-spacing: 0.5px;
}

.card-glass-info .role {
  color: #9fcb2d;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.card-glass-info .specialty {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.card-glass-info .socials {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

/* --- Botón de Flecha (Flip) --- */

.flip-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.flip-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

/* --- Scroller en la parte de atrás --- */

.scroller-content {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.scroller-content h4 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.scroller-content p {
  margin-bottom: 15px;
}

/* Scrollbar personalizado */

.scroller-content::-webkit-scrollbar {
  width: 4px;
}

.scroller-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.scroller-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.scroller-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* --- Flechas de Navegación del Carrusel --- */

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0,0,0,0.35);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.prev-arrow {
  left: 20px;
}

.next-arrow {
  right: 20px;
}

