/* ============================================
   GHRC Website - Team Trading Cards
   ============================================ */

.team-section {
  padding: var(--section-padding);
  position: relative;
  overflow: hidden;
}

/* ── Floating Shoe Print Background ── */
.team-section__shoe-prints {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.team-section__shoe-print {
  position: absolute;
  font-size: 24px;
  opacity: 0;
  animation: shoe-print-float var(--duration, 15s) var(--delay, 0s) linear infinite;
  --rotation: var(--rot, 15deg);
}

/* ── Cards Grid ── */
.team__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Trading Card ── */
.team-card {
  perspective: 1000px;
  height: 420px;
  cursor: pointer;
  width: calc((100% - 3 * var(--space-8)) / 4);
}

.team-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s var(--ease-out);
  transform-style: preserve-3d;
}

.team-card:hover .team-card__inner,
.team-card.flipped .team-card__inner {
  transform: rotateY(180deg);
}

/* ── Card Faces ── */
.team-card__front,
.team-card__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* ── Front Face ── */
.team-card__front {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--space-6);
}

.team-card__photo-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  margin-bottom: var(--space-6);
}

.team-card__photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-primary);
  box-shadow: var(--shadow-glow);
}

/* Fallback initials circle (shown when no photo or photo fails to load) */
.team-card__fallback {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: white;
}

/* Role badge on photo */
.team-card__role-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.team-card__name {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
  text-align: center;
}

.team-card__role {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.team-card__flip-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ── Back Face ── */
.team-card__back {
  background: linear-gradient(135deg, var(--color-secondary), #1a1a1a);
  color: var(--color-white);
  transform: rotateY(180deg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
}

.team-card__back-header {
  text-align: center;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-4);
}

.team-card__back-name {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-primary);
}

.team-card__stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.team-card__stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.team-card__stat-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.team-card__stat-value {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-white);
}

.team-card__fun-fact {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  line-height: var(--leading-relaxed);
}

.team-card__fun-fact::before {
  content: '\201C';
  color: var(--color-primary);
  font-size: var(--text-2xl);
  font-style: normal;
  line-height: 0;
  vertical-align: -8px;
  margin-right: var(--space-1);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .team-card {
    height: 380px;
    width: calc((100% - var(--space-8)) / 2);
  }

  .team-card__photo-wrapper {
    width: 120px;
    height: 120px;
  }

  /* On mobile, tap to flip instead of hover */
  .team-card:hover .team-card__inner {
    transform: rotateY(0deg);
  }

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

@media (max-width: 480px) {
  .team-card {
    width: 100%;
  }
}
