/* ========================================
   EXPERT-LEVEL UI ENHANCEMENTS & ANIMATIONS
   ======================================== */

/* Floating Background Decorations */
.floating-decoration {
  position: fixed;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  animation: floatAnimation 20s ease-in-out infinite;
}

.pot-decoration {
  width: 200px;
  height: 200px;
  background: url('/images/handDrawnPot.png') no-repeat center/contain;
  top: 15%;
  right: 5%;
  animation-delay: 0s;
}

.knife-decoration {
  width: 180px;
  height: 180px;
  background: url('/images/handDrawnKnife.png') no-repeat center/contain;
  bottom: 20%;
  left: 3%;
  animation-delay: 7s;
}

.bowl-decoration {
  width: 150px;
  height: 150px;
  background: url('/images/handDrawnBowl.png') no-repeat center/contain;
  top: 60%;
  right: 8%;
  animation-delay: 14s;
}

@keyframes floatAnimation {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(5deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(20px) rotate(-5deg);
  }
}

/* Enhanced Hero Section */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(218, 165, 32, 0.15);
  border: 2px solid var(--golden-harvest);
  padding: 8px 20px;
  border-radius: 50px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mahogany);
  animation: badgeFadeIn 0.6s ease-out;
}

.badge-icon {
  animation: leafFloat 3s ease-in-out infinite;
}

@keyframes leafFloat {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-3px); }
}

@keyframes badgeFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  animation: titleSlideIn 0.8s ease-out 0.2s both;
}

@keyframes titleSlideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.highlight-animated {
  position: relative;
  display: inline-block;
  animation: highlightPulse 2s ease-in-out infinite;
}

.highlight-animated::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(90deg, transparent, rgba(218, 165, 32, 0.3), transparent);
  animation: underlineSweep 2s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% {
    text-shadow: 2px 2px 0px rgba(218, 165, 32, 0.3);
  }
  50% {
    text-shadow: 3px 3px 8px rgba(218, 165, 32, 0.5);
  }
}

@keyframes underlineSweep {
  0%, 100% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 48px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.6);
  border: 3px solid rgba(139, 69, 19, 0.2);
  border-radius: 3px;
  box-shadow: 4px 4px 0px rgba(139, 69, 19, 0.1);
  animation: statsFadeIn 1s ease-out 0.6s both;
}

@keyframes statsFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 900;
  font-family: 'Playfair Display', serif;
  color: var(--pumpkin-spice);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--mahogany);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-divider {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--burnt-sienna), transparent);
}

/* Animated Buttons */
.btn-animated {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-animated:hover::before {
  width: 300px;
  height: 300px;
}

.btn-animated:hover {
  transform: translate(-3px, -3px) scale(1.02);
  box-shadow:
    7px 7px 0px rgba(107, 52, 16, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn-arrow {
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.btn-animated:hover .btn-arrow {
  transform: translateX(5px);
}

/* Video Container Enhancement */
.video-animated {
  position: relative;
  animation: videoReveal 1s ease-out 0.4s both;
}

@keyframes videoReveal {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateY(-15deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) rotateY(0);
  }
}

.video-frame-decoration {
  position: absolute;
  top: -15px;
  right: -15px;
  bottom: -15px;
  left: -15px;
  border: 3px solid var(--golden-harvest);
  border-radius: 5px;
  pointer-events: none;
  opacity: 0.4;
  z-index: -1;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 60px;
  animation: sectionFadeIn 0.8s ease-out;
}

.section-label {
  display: inline-block;
  background: var(--golden-harvest);
  color: var(--sepia-dark);
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  box-shadow: 3px 3px 0px rgba(139, 69, 19, 0.2);
}

.section-subtitle {
  font-size: 18px;
  color: var(--mahogany);
  margin-top: 16px;
  font-style: italic;
  opacity: 0.9;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Feature Cards */
.feature-card-animated {
  position: relative;
  overflow: hidden;
}

.feature-card-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(218, 165, 32, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.feature-card-animated:hover::before {
  opacity: 1;
}

.feature-icon-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.15));
}

.feature-card-animated:hover .feature-icon-img {
  transform: scale(1.1) rotate(5deg);
}

.icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(218, 165, 32, 0.3), transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.feature-card-animated:hover .icon-glow {
  opacity: 1;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
}

.feature-decoration {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--golden-harvest), transparent);
  transform: scaleX(0);
  transition: transform 0.5s ease;
}

.feature-card-animated:hover .feature-decoration {
  transform: scaleX(1);
}

/* Enhanced Screenshot Cards */
.screenshot-animated {
  transform-origin: center;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.screenshot-frame {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  margin-bottom: 20px;
}

.screenshot-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(218, 165, 32, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.screenshot-animated:hover .screenshot-frame::before {
  opacity: 1;
}

.screenshot-card p {
  font-size: 14px;
  color: var(--mahogany);
  margin-top: 8px;
  opacity: 0.8;
}

/* Enhanced Steps */
.step-animated {
  position: relative;
  transition: all 0.4s ease;
}

.step-animated:hover {
  transform: translateY(-8px);
}

.step-icon-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.step-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.15));
  transition: transform 0.4s ease;
}

.step-animated:hover .step-icon-img {
  transform: scale(1.1) rotate(-5deg);
}

.step-number {
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 50px;
  height: 50px;
  background: var(--pumpkin-spice);
  color: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  font-family: 'Playfair Display', serif;
  border: 4px solid var(--cream);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
  animation: numberPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes numberPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-connector svg {
  animation: arrowSlide 1.5s ease-in-out infinite;
}

@keyframes arrowSlide {
  0%, 100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(10px); opacity: 1; }
}

/* Enhanced Install Section */
.install-animated {
  position: relative;
  overflow: hidden;
  animation: installReveal 0.8s ease-out;
}

@keyframes installReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.install-decoration {
  position: absolute;
  width: 200px;
  height: 200px;
  opacity: 0.15;
  animation: decorationFloat 8s ease-in-out infinite;
}

.install-decoration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: sepia(0.3);
}

.install-decoration-left {
  top: -50px;
  left: -50px;
  animation-delay: 0s;
}

.install-decoration-right {
  bottom: -50px;
  right: -50px;
  animation-delay: 4s;
}

@keyframes decorationFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(10px, -10px) rotate(5deg); }
  50% { transform: translate(0, 0) rotate(0deg); }
  75% { transform: translate(-10px, 10px) rotate(-5deg); }
}

/* Logo Animation */
.logo-animated {
  transition: transform 0.3s ease;
}

.logo-animated:hover {
  transform: scale(1.05);
}

.logo-animated .logo-icon {
  transition: transform 0.3s ease;
}

.logo-animated:hover .logo-icon {
  transform: rotate(10deg);
}

/* Nav Link Enhancements */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--pumpkin-spice);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Trust Badge Enhancement */
.trust-icon {
  display: inline-block;
  animation: starTwinkle 2s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

/* Scroll Reveal Animations */
@media (prefers-reduced-motion: no-preference) {
  .feature-card-animated,
  .screenshot-animated,
  .step-animated {
    opacity: 0;
    transform: translateY(30px);
    animation: scrollReveal 0.6s ease-out forwards;
  }

  .feature-card-animated:nth-child(1) { animation-delay: 0.1s; }
  .feature-card-animated:nth-child(2) { animation-delay: 0.2s; }
  .feature-card-animated:nth-child(3) { animation-delay: 0.3s; }
  .feature-card-animated:nth-child(4) { animation-delay: 0.4s; }
  .feature-card-animated:nth-child(5) { animation-delay: 0.5s; }
  .feature-card-animated:nth-child(6) { animation-delay: 0.6s; }

  .screenshot-animated:nth-child(1) { animation-delay: 0.1s; }
  .screenshot-animated:nth-child(2) { animation-delay: 0.2s; }
  .screenshot-animated:nth-child(3) { animation-delay: 0.3s; }
  .screenshot-animated:nth-child(4) { animation-delay: 0.4s; }

  .step-animated:nth-child(odd) { animation-delay: 0.1s; }
  .step-animated:nth-child(even) { animation-delay: 0.3s; }
}

@keyframes scrollReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .floating-decoration {
    display: none;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }

  .stat-divider {
    width: 60%;
    height: 2px;
  }

  .feature-icon-wrapper,
  .step-icon-wrapper {
    width: 100px;
    height: 100px;
  }

  .install-decoration {
    display: none;
  }
}
