/* =========================================
   TASKAUTO.AI — Animations, Hover Effects & Mobile Polish
   ========================================= */

/* --- Enhanced Button Interactions --- */
.btn {
  transition: all 0.25s ease;
}

.btn--primary:hover {
  box-shadow: 0 8px 35px rgba(108, 92, 231, 0.5);
  transform: translateY(-2px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(108, 92, 231, 0.3);
}

.btn--outline:hover {
  background: rgba(108, 92, 231, 0.05);
}

.btn--outline:active {
  background: rgba(108, 92, 231, 0.1);
}

/* Primary CTA pulse for hero and final CTA */
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3); }
  50% { box-shadow: 0 4px 30px rgba(108, 92, 231, 0.5), 0 0 20px rgba(108, 92, 231, 0.15); }
}

.hero__form .btn--primary,
.final-cta .btn--primary {
  animation: cta-pulse 3s ease-in-out infinite;
}

.hero__form .btn--primary:hover,
.final-cta .btn--primary:hover {
  animation: none;
}

/* --- Nav Link Hover Underline Animation --- */
.nav__links a {
  position: relative;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
  border-radius: 1px;
  transition: width 0.3s ease;
}

.nav__links a:hover::after {
  width: 100%;
}

/* --- Burger menu animation to X --- */
.nav__burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__burger.active span:nth-child(2) {
  opacity: 0;
}

.nav__burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Mobile Nav Transition --- */
@media (max-width: 768px) {
  .nav__links {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .nav__links--open {
    opacity: 1 !important;
    pointer-events: auto;
  }
}

/* --- Feature Card Enhanced Hover --- */
.feature-card:hover {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2), 0 0 30px rgba(108, 92, 231, 0.06);
}

.feature-card:hover .feature-card__icon {
  background: rgba(108, 92, 231, 0.25);
  transition: background 0.3s ease;
}

.feature-card__icon {
  transition: background 0.3s ease;
}

/* --- Compare Card Hover --- */
.compare__card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.compare__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.compare__card--new:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 30px rgba(108, 92, 231, 0.08);
}

/* --- Testimonial Card Enhanced Hover --- */
.testimonial:hover {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

/* --- Pricing Card Hover --- */
.pricing__card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.25), 0 0 40px rgba(108, 92, 231, 0.08);
}

/* --- FAQ Item Enhanced Interactions --- */
.faq__item {
  transition: border-color 0.2s ease, background 0.2s ease;
}

.faq__item:hover {
  border-color: var(--border-light);
}

.faq__item[open] {
  background: rgba(18, 18, 26, 0.8);
}

.faq__item summary {
  transition: color 0.2s ease, padding 0.2s ease;
}

.faq__item summary::after {
  transition: transform 0.3s ease, color 0.2s ease;
}

.faq__item[open] summary::after {
  transform: rotate(180deg);
}

.faq__item summary:hover::after {
  color: var(--accent-light);
}

/* --- Footer Link Hover --- */
.footer__col a {
  position: relative;
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer__col a:hover {
  color: var(--text);
  transform: translateX(3px);
}

/* --- Logo Strip Hover --- */
.logos__strip span {
  transition: opacity 0.3s ease;
}

.logos__strip span:hover {
  opacity: 0.75;
}

/* --- Enhanced Form Input Focus States --- */
.hero__form input,
.pricing__form input {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hero__form input:focus,
.pricing__form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* --- Scroll Animation Variants --- */
.slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* --- Step Number Hover --- */
.step__number {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step:hover .step__number {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

/* --- Hero Badge Subtle Float --- */
@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.hero__badge {
  animation: badge-float 3s ease-in-out infinite;
}

/* --- Mockup Subtle Float --- */
@keyframes mockup-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero__visual .mockup {
  animation: mockup-float 5s ease-in-out infinite;
}

/* --- Calendar Event Hover --- */
.cal-mockup__event {
  transition: transform 0.2s ease;
}

.cal-mockup__event:hover {
  transform: scale(1.05);
}

/* --- Form Success Animation --- */
@keyframes success-appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-success {
  animation: success-appear 0.4s ease forwards;
}

/* --- Mobile Responsive Enhancements --- */

/* Ensure touch targets are at least 44px */
@media (max-width: 768px) {
  .nav__burger {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .faq__item summary {
    min-height: 44px;
    padding: 16px 20px;
  }

  .footer__col a {
    padding: 4px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Fix hero form on mobile */
  .hero__form .btn--primary {
    min-height: 48px;
  }

  /* Improve mobile nav link touch targets */
  .nav__links a {
    padding: 8px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Disable hover-only effects on mobile for better touch experience */
  .feature-card:hover,
  .testimonial:hover,
  .compare__card:hover {
    transform: none;
  }

  /* Remove float animation on mobile for performance */
  .hero__visual .mockup {
    animation: none;
  }

  .hero__badge {
    animation: none;
  }

  /* Ensure section padding is sensible on mobile */
  .compare,
  .features,
  .steps,
  .calendar-section,
  .testimonials,
  .pricing,
  .faq,
  .final-cta {
    padding: 80px 0;
  }
}

@media (max-width: 480px) {
  /* Reduce section padding further */
  .compare,
  .features,
  .steps,
  .calendar-section,
  .testimonials,
  .pricing,
  .faq,
  .final-cta {
    padding: 60px 0;
  }

  /* Ensure hero proof text wraps well */
  .hero__proof {
    font-size: 0.8rem;
    text-align: center;
  }

  /* Pricing card text alignment */
  .pricing__card {
    padding: 32px 20px;
  }

  /* FAQ mobile padding */
  .faq__item summary {
    padding: 16px 16px;
    font-size: 0.92rem;
  }

  .faq__item p {
    padding: 0 16px 16px;
    font-size: 0.9rem;
  }

  /* Calendar responsive adjustments */
  .cal-mockup__day {
    min-height: 52px;
    padding: 4px 4px 6px;
  }

  .cal-mockup__event {
    font-size: 0.56rem;
    padding: 2px 4px;
  }
}

/* --- Reduce motion for accessibility --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-up,
  .slide-left,
  .slide-right,
  .scale-in {
    opacity: 1;
    transform: none;
  }
}
