/* ============================================
   TEAM QUOTE CAROUSEL
   A subtle, elegant team quote carousel with
   glassmorphism cards and auto-cycling animation.
   
   Integrated with Taley brand colors from base.css
   ============================================ */

/* Section Container - Blends with page background */
.team-quote-section {
  /* Unified mint flow - inherits page background */
  background: transparent;
  /* Social Proof Zone */
  padding: var(--section-padding-md, 64px) var(--space-6, 24px);
  position: relative;
  overflow-x: clip;
  /* Prevent mascot from causing horizontal scroll */
}

/* Section Header - Matches other sections on the page */
.team-quote-section .section-header {
  text-align: center;
  margin-bottom: var(--heading-margin, 32px);
}

.team-quote-section .section-header h2 {
  color: var(--gray-800, #1d1d1f);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.team-quote-section .section-header p {
  color: var(--gray-500, #6e6e73);
  font-size: 1rem;
}

/* Carousel Container */
.team-quote-container {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
}

/* Carousel Wrapper - Increased height for stacked effect */
.team-quote-carousel {
  position: relative;
  min-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

/* Quote Card - Subtle Glassmorphism with 3D stacking */
.team-quote-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  /* Light glass effect with green tint to match brand */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--gray-200, #e8e8ed);
  border-radius: var(--radius-lg, 20px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1));
  max-width: 550px;
  width: 100%;
  cursor: pointer;

  /* Stacked/hidden state - behind active card */
  opacity: 0.4;
  transform: translateY(16px) scale(0.92);
  pointer-events: none;
  z-index: 1;
  transition:
    opacity 0.4s var(--ease-ios, cubic-bezier(0.2, 0.8, 0.2, 1)),
    transform 0.4s var(--ease-ios, cubic-bezier(0.2, 0.8, 0.2, 1)),
    z-index 0s linear 0.2s;
}

/* Cards stacked behind - visible depth effect */
.team-quote-card[data-position='1'] {
  opacity: 0.35;
  transform: translateY(10px) scale(0.95);
  z-index: 5;
}

.team-quote-card[data-position='2'] {
  opacity: 0.2;
  transform: translateY(20px) scale(0.9);
  z-index: 4;
}

.team-quote-card[data-position='3'] {
  opacity: 0.1;
  transform: translateY(30px) scale(0.85);
  z-index: 3;
}

/* Active card - front and center */
.team-quote-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  z-index: 10;
  transition:
    opacity 0.4s var(--ease-ios, cubic-bezier(0.2, 0.8, 0.2, 1)),
    transform 0.4s var(--ease-ios, cubic-bezier(0.2, 0.8, 0.2, 1)),
    z-index 0s linear 0s;
}

/* Hover effect for active card */
.team-quote-card.active:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
}

/* Photo */
.team-quote-photo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md, 12px);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--green-bg, #e8f5e9);
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));
}

/* Content wrapper */
.team-quote-content {
  flex: 1;
  min-width: 0;
}

/* Attribution (name & role) */
.team-quote-attribution {
  display: block;
  font-size: 0.8rem;
  color: var(--green-dark, #2e7d32);
  margin-bottom: 0.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Quote text */
.team-quote-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--gray-700, #1d1d1f);
  margin: 0;
  font-style: italic;
}

/* Navigation Dots */
.team-quote-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.quote-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400, #86868b);
  border: none;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

.quote-dot:hover {
  background: var(--gray-500, #6e6e73);
  transform: scale(1.15);
}

.quote-dot.active {
  background: var(--green-primary, #4caf50);
  transform: scale(1.15);
}

/* CTA Button wrapper */
.team-quote-cta {
  text-align: center;
  margin-top: 2rem;
}

.team-quote-section .cta-button {
  display: inline-block;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet and below */
@media (max-width: 768px) {
  .team-quote-section {
    padding: 3rem 1rem;
  }

  .team-quote-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 1rem;
  }

  .team-quote-photo {
    width: 70px;
    height: 70px;
  }

  .team-quote-text {
    font-size: 0.95rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .team-quote-carousel {
    min-height: 220px;
  }

  .team-quote-card {
    padding: 1.25rem;
  }

  .team-quote-photo {
    width: 60px;
    height: 60px;
  }

  .team-quote-attribution {
    font-size: 0.8rem;
  }

  .team-quote-text {
    font-size: 0.9rem;
  }
}

/* ============================================
   MASCOT & SPEECH BUBBLE (Team Section)
   ============================================ */
.team-mascot-wrapper {
  position: absolute;
  right: -200px;
  /* Moved closer to content (Companion) */
  bottom: -200px;
  /* Moved further down */
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  pointer-events: none;
  /* Let clicks pass through */
}

.team-speech-bubble {
  background: white;
  border-radius: 16px;
  /* Slightly tighter radius */
  padding: 0.5rem 1rem;
  /* Smaller padding */
  font-size: 0.8rem;
  /* Smaller text */
  font-weight: 600;
  color: var(--gray-800, #1d1d1f);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 6px;
  position: relative;
  max-width: 160px;
  /* Smaller bubble */
  text-align: center;
  /* Speech bubble tail */
}

.team-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

.team-mascot-img {
  width: 100px;
  /* Matched to mascot-signup */
  height: auto;
  transform: rotate(-8deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  /* Matched shadow */
  animation: float 6s ease-in-out infinite;
  /* Matched animation */
}

/* Adjust section header to allow absolute positioning context */
.team-quote-section .section-header {
  position: relative;
  display: block;
  /* Wraps content so we can position relative to it */
  width: 100%;
  max-width: 700px;
  /* Constrain width for centering */
  margin: 0 auto var(--heading-margin, 50px);
}

/* Tablet adjustments */
@media (max-width: 1100px) {
  .team-mascot-wrapper {
    right: -180px;
    /* Offset more for tablet too */
    bottom: -80px;
    /* Lower for tablet too */
  }

  .team-mascot-img {
    width: 80px;
    /* Matched to mascot-signup responsive */
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .team-quote-section .section-header {
    display: block;
    max-width: 100%;
    margin-bottom: 2rem;
  }

  .team-mascot-wrapper {
    position: relative;
    right: auto;
    bottom: auto;
    flex-direction: row;
    /* Horizontal on mobile? Or keep stacked? Stacked is better for bubble */
    margin: 1rem auto 0;
    justify-content: center;
  }

  .team-mascot-img {
    width: 80px;
    /* Matched to mascot-signup responsive */
    transform: rotate(0deg);
  }

  .team-speech-bubble {
    font-size: 0.75rem;
    /* Smaller text */
    padding: 0.4rem 0.8rem;
    max-width: 200px;
    margin-bottom: 40px;
    margin-right: 8px;
    /* Tighter gap */
    /* Gap between bubble and mascot if side-by-side, but here we stack? */
  }

  /* Let's actually do side-by-side for mobile to save vertical space */
  .team-mascot-wrapper {
    flex-direction: row;
    align-items: flex-end;
  }

  .team-speech-bubble::after {
    /* Point to right -> mascot */
    bottom: 15px;
    left: 100%;
    transform: none;
    border-width: 6px 0 6px 8px;
    /* Arrow pointing right */
    border-color: transparent transparent transparent white;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .team-quote-card {
    transition: opacity 0.3s ease;
    transform: none !important;
  }

  .team-quote-card.active {
    transform: none !important;
  }

  .quote-dot {
    transition: none;
  }
}
