/* =========================================
   ANIMATIONS & KEYFRAMES
   ========================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

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

@keyframes floatSmooth {
  0%, 100% {
    transform: translateY(0);
  }

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

/* =========================================
   INTERACTIVE QUOTE CARD (3D Flip)
   ========================================= */
.quote-card-section {
  padding: 6rem 5%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  position: relative;
  perspective: 1200px;
}

.quote-card-container {
  width: 100%;
  max-width: 650px;
  /* Increased max-width to give text more room */
  min-height: 280px;
  /* Slight height adjustment */
  position: relative;
  cursor: pointer;
  /* Slow, smooth transition for reverting back to normal */
  transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 10;
}

.quote-card {
  width: 100%;
  height: 100%;
  position: absolute;
  /* Slow, smooth transition for flipping back */
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  transform-style: preserve-3d;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Shared styles for Front and Back */
.quote-card-front,
.quote-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 3.5rem;
  /* Adjusted padding to maximize text width */
  text-align: center;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  /* Glassmorphism background with ambient glow */
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* The moving background animation (ambient glow) */
.quote-card-front::before,
.quote-card-back::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(242, 202, 0, 0.15), transparent 60%);
  animation: ambientPulse 6s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes ambientPulse {
  0% {
    transform: scale(1) translate(0, 0);
    opacity: 0.5;
  }

  100% {
    transform: scale(1.2) translate(5%, 5%);
    opacity: 1;
  }
}

.quote-card-front h3,
.quote-card-front span,
.quote-card-back p,
.quote-card-back .highlight {
  position: relative;
  z-index: 2;
}

.quote-card-front h3 {
  font-size: 1.35rem;
  /* Slightly reduced font size to fit exactly 3 lines */
  color: #fff;
  line-height: 1.6;
  margin: 0;
}

.quote-card-front span {
  display: block;
  margin-top: 1.5rem;
  color: var(--brand-yellow);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.quote-card-back {
  transform: rotateY(180deg);
  border-color: rgba(242, 202, 0, 0.3);
}

.quote-card-back p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.quote-card-back .highlight {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* HOVER STATE: Expand slightly, flip, vibrate */
.quote-card-container:hover {
  max-width: 800px;
  /* Fast enter animation for width expansion */
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quote-card-container:hover .quote-card {
  transform: rotateY(180deg);
  box-shadow: 0 40px 100px rgba(242, 202, 0, 0.2);
  animation: intense-vibrate 0.4s ease-in-out;
  /* Fast enter animation for flipping */
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes intense-vibrate {
  0% {
    transform: rotateY(180deg) translate(0);
  }

  20% {
    transform: rotateY(180deg) translate(-3px, 3px);
  }

  40% {
    transform: rotateY(180deg) translate(-3px, -3px);
  }

  60% {
    transform: rotateY(180deg) translate(3px, 3px);
  }

  80% {
    transform: rotateY(180deg) translate(3px, -3px);
  }

  100% {
    transform: rotateY(180deg) translate(0);
  }
}

@media (max-width: 992px) {
  .quote-card-container {
    min-height: 400px;
  }

  .quote-card-front h3 {
    font-size: 1.2rem;
  }

  .quote-card-back {
    padding: 2rem;
  }

  .quote-card-back .highlight {
    font-size: 1.3rem;
  }
}
