/* ==========================================================================
   SEÇÃO NOSSO TIME / EQUIPE - 7 SOLUÇÕES DIGITAIS
   Design imersivo, glassmorphism e microinterações
   ========================================================================== */

.team-section {
  position: relative;
  padding: 100px 0;
  z-index: 2;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3.5rem;
}

.team-card {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 1px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  isolation: isolate;
  box-sizing: border-box;
}

.team-card:hover {
  transform: translateY(-8px) translate3d(0, 0, 0);
  box-shadow: 0 25px 50px -10px rgba(139, 92, 246, 0.28), 0 0 25px rgba(168, 85, 247, 0.16);
}

/* O Feixe de Borda Animado (Border Beam Sutil) */
.team-card::before {
  content: '';
  position: absolute;
  top: -65%;
  left: -65%;
  width: 230%;
  height: 230%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  transition: opacity 0.4s ease, filter 0.4s ease;
  will-change: transform;
}

.team-card:hover::before {
  opacity: 0.95;
  filter: drop-shadow(0 0 5px rgba(184, 107, 255, 0.45));
}

/* BORDAS ALEATÓRIAS / DESSINCRONIZADAS POR CARD */

/* Card 1: Sentido horário, rotação em 8.2s, início em ângulo 45deg */
.team-grid .team-card:nth-child(3n + 1)::before {
  background: conic-gradient(
    from 45deg,
    transparent 0deg,
    transparent 190deg,
    rgba(184, 107, 255, 0.02) 220deg,
    rgba(184, 107, 255, 0.45) 248deg,
    rgba(235, 210, 255, 0.85) 262deg,
    rgba(184, 107, 255, 0.45) 276deg,
    rgba(184, 107, 255, 0.02) 305deg,
    transparent 330deg,
    transparent 360deg
  );
  animation: teamBorderBeam 8.2s linear infinite;
  animation-delay: -2.3s;
}

/* Card 2: Sentido anti-horário (reverse), rotação mais lenta em 11.4s, início em 210deg */
.team-grid .team-card:nth-child(3n + 2)::before {
  background: conic-gradient(
    from 210deg,
    transparent 0deg,
    transparent 180deg,
    rgba(168, 85, 247, 0.02) 210deg,
    rgba(168, 85, 247, 0.42) 242deg,
    rgba(243, 232, 255, 0.82) 258deg,
    rgba(168, 85, 247, 0.42) 272deg,
    rgba(168, 85, 247, 0.02) 300deg,
    transparent 330deg,
    transparent 360deg
  );
  animation: teamBorderBeam 11.4s linear infinite reverse;
  animation-delay: -6.8s;
}

/* Card 3: Sentido horário, cadência assimétrica de 9.5s, início em 320deg */
.team-grid .team-card:nth-child(3n)::before {
  background: conic-gradient(
    from 320deg,
    transparent 0deg,
    transparent 185deg,
    rgba(192, 132, 252, 0.02) 215deg,
    rgba(192, 132, 252, 0.48) 250deg,
    rgba(245, 208, 254, 0.88) 265deg,
    rgba(192, 132, 252, 0.48) 280deg,
    rgba(192, 132, 252, 0.02) 310deg,
    transparent 335deg,
    transparent 360deg
  );
  animation: teamBorderBeam 9.5s linear infinite;
  animation-delay: -4.1s;
}

/* Variação para grids com 4 ou mais cards */
.team-grid .team-card:nth-child(4n)::before {
  animation-duration: 12.8s;
  animation-delay: -8.5s;
  animation-direction: reverse;
}

@keyframes teamBorderBeam {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-card::before {
    animation: none !important;
    opacity: 0.3 !important;
  }
}

.team-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #120e1e;
  border-top-left-radius: 19px;
  border-top-right-radius: 19px;
  margin-bottom: -3px;
  z-index: 2;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.team-image-wrapper img {
  width: 100%;
  height: calc(100% + 4px);
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

.team-card:hover .team-image-wrapper img {
  transform: scale(1.04) translate3d(0, 0, 0);
}

.team-image-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: -4px;
  background: linear-gradient(to top, #120e1e 0%, #120e1e 6%, rgba(18, 14, 30, 0.75) 32%, rgba(18, 14, 30, 0.2) 65%, transparent 85%);
  pointer-events: none;
  z-index: 2;
}

.team-info {
  position: relative;
  z-index: 2;
  background: #120e1e;
  padding: 1.4rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  border-bottom-left-radius: 19px;
  border-bottom-right-radius: 19px;
}

.team-role {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c084fc;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, #c084fc, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.team-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.4px;
  margin: 0 0 0.65rem 0;
  line-height: 1.25;
}

.team-bio {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
  flex: 1;
}

.team-socials {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.team-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.25s ease;
}

.team-social-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
}

.team-social-btn.email:hover {
  background: linear-gradient(135deg, rgba(123, 46, 255, 0.35), rgba(184, 107, 255, 0.35));
  border-color: rgba(184, 107, 255, 0.6);
  box-shadow: 0 4px 14px rgba(123, 46, 255, 0.3);
}

.team-social-btn svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 768px) {
  .team-section {
    padding: 70px 0;
  }
  .team-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
  }
  .team-info {
    padding: 1.25rem 1.4rem 1.5rem;
  }
}
