/* ==========================================================================
   Premium Website Enhancements - The Coach Angelo
   Version 2.0 - $15k Website Upgrade
   ========================================================================== */

/* ==========================================================================
   1. SCROLL ANIMATIONS
   ========================================================================== */

/* Base animation states */
[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade variations */
[data-animate="fade-up"] {
  transform: translateY(60px);
}

[data-animate="fade-down"] {
  transform: translateY(-60px);
}

[data-animate="fade-left"] {
  transform: translateX(60px);
}

[data-animate="fade-right"] {
  transform: translateX(-60px);
}

[data-animate="fade-up"].is-visible,
[data-animate="fade-down"].is-visible,
[data-animate="fade-left"].is-visible,
[data-animate="fade-right"].is-visible {
  transform: translate(0, 0);
}

/* Scale animations */
[data-animate="zoom-in"] {
  transform: scale(0.9);
}

[data-animate="zoom-in"].is-visible {
  transform: scale(1);
}

/* Stagger delays for grid items */
[data-animate-delay="100"] { transition-delay: 0.1s; }
[data-animate-delay="200"] { transition-delay: 0.2s; }
[data-animate-delay="300"] { transition-delay: 0.3s; }
[data-animate-delay="400"] { transition-delay: 0.4s; }
[data-animate-delay="500"] { transition-delay: 0.5s; }
[data-animate-delay="600"] { transition-delay: 0.6s; }

/* ==========================================================================
   2. GLASSMORPHISM HEADER
   ========================================================================== */

header,
.site-header {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Header shrink on scroll */
header.scrolled,
.site-header.scrolled {
  height: 56px !important;
  padding: 0 24px !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12) !important;
}

header.scrolled .logo img,
.site-header.scrolled .logo img {
  height: 40px !important;
  transition: height 0.3s ease;
}

header.scrolled .logo-wordmark,
.site-header.scrolled .logo-wordmark {
  font-size: 1.1rem;
}

/* ==========================================================================
   3. MOBILE HAMBURGER MENU
   ========================================================================== */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark, #1e1e1e);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: absolute;
}

.nav-toggle span:nth-child(1) { transform: translateY(-8px); }
.nav-toggle span:nth-child(2) { transform: translateY(0); }
.nav-toggle span:nth-child(3) { transform: translateY(8px); }

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(0);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(0);
}

/* Mobile navigation */
@media (max-width: 1000px) {
  .nav-toggle {
    display: flex;
  }

  nav,
  .main-nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 380px !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 100px 32px 40px !important;
    gap: 0 !important;
    box-shadow: -10px 0 60px rgba(0, 0, 0, 0.15) !important;
    transform: translateX(100%) !important;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    z-index: 1000;
    overflow-y: auto;
  }

  nav.open,
  .main-nav.open {
    transform: translateX(0) !important;
  }

  nav a,
  .main-nav a {
    display: block !important;
    padding: 18px 0 !important;
    font-size: 1.1rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    text-align: left !important;
  }

  nav .btn-nav,
  .main-nav .btn-nav {
    margin-top: 24px !important;
    text-align: center !important;
    padding: 16px 24px !important;
  }

  /* Overlay */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 999;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* ==========================================================================
   4. ANIMATED STAT COUNTERS
   ========================================================================== */

.stat-item strong,
.stat-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.stat-item {
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-item:hover::before {
  opacity: 1;
}

/* ==========================================================================
   5. ENHANCED HOVER STATES
   ========================================================================== */

/* Card hover effects */
.feature-card,
.protocol-card,
.program-card,
.testimonial-card,
.transform-card,
.video-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease !important;
}

.feature-card:hover,
.protocol-card:hover,
.program-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

.transform-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18) !important;
}

/* Button hover effects */
.btn-primary,
.btn-gold,
.btn-nav {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary::before,
.btn-gold::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before,
.btn-gold:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover,
.btn-gold:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 15px 40px rgba(64, 110, 223, 0.3) !important;
}

/* Link hover effects */
nav a::after,
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--blue, #406edf);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

nav a {
  position: relative;
}

nav a:hover::after {
  width: 100%;
}

/* Icon hover effects */
.cred-icon,
.check,
.x-icon {
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              box-shadow 0.3s ease !important;
}

.cred-item:hover .cred-icon,
.protocol-list li:hover .check {
  transform: scale(1.2) rotate(5deg);
  box-shadow: 0 4px 15px rgba(64, 110, 223, 0.4);
}

/* Avatar hover */
.avatar,
.testimonial-avatar {
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              box-shadow 0.3s ease !important;
}

.testimonial-card:hover .avatar,
.testimonial-meta:hover .avatar {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(64, 110, 223, 0.35);
}

/* ==========================================================================
   6. PARALLAX EFFECTS
   ========================================================================== */

.hero,
.page-hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(64, 110, 223, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(223, 177, 64, 0.08) 0%, transparent 50%);
  animation: parallaxBg 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes parallaxBg {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-5%, -5%) rotate(3deg); }
}

/* Floating elements */
.hero-image {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Stats band gradient animation */
.stats-band {
  position: relative;
  overflow: hidden;
}

.stats-band::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

/* ==========================================================================
   7. TYPOGRAPHY & DECORATIVE ELEMENTS
   ========================================================================== */

/* Refined typography */
.section-label {
  position: relative;
  display: inline-block;
  padding-left: 50px;
}

.section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 36px;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

.section-title {
  position: relative;
}

/* Gradient text for highlighted spans */
.section-title span,
.hero-text h1 span,
.page-hero h1 span {
  background: linear-gradient(135deg, var(--blue, #406edf) 0%, #6a8fe6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gold gradient for gold spans */
.success-stories-title span {
  background: linear-gradient(135deg, var(--gold, #dfb140) 0%, #f0c850 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced quotes */
.testimonial-card .quote,
.transform-quote,
.quote {
  position: relative;
  padding-left: 24px;
}

.testimonial-card .quote::before,
.quote::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -8px;
  font-family: Georgia, serif;
  font-size: 3rem;
  color: var(--blue, #406edf);
  opacity: 0.3;
  line-height: 1;
}

/* Card badges with glow */
.popular-badge,
.card-kicker {
  position: relative;
  box-shadow: 0 4px 15px rgba(223, 177, 64, 0.3);
}

/* Divider lines */
.section-inner::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue, #406edf), var(--gold, #dfb140));
  margin-top: 20px;
  border-radius: 2px;
  opacity: 0;
}

.struggles-section .section-inner::after,
.features-section .section-inner::after,
.about-section .section-inner::after {
  opacity: 1;
}

/* ==========================================================================
   8. GLASSMORPHISM CARDS
   ========================================================================== */

/* Dark section cards with glass effect */
.testimonials-section .testimonial-card,
.protocol-band .protocol-card {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Light cards with subtle glass */
.feature-card {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   9. ENHANCED SECTIONS
   ========================================================================== */

/* Gift section animated gradient */
.gift-section,
.protocol-cta,
.cta-band {
  position: relative;
  overflow: hidden;
}

.gift-section::before,
.protocol-cta::before,
.cta-band::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* FAQ enhanced styling */
.faq-item {
  transition: background 0.3s ease;
}

.faq-item:hover {
  background: rgba(64, 110, 223, 0.03);
}

.faq-q {
  transition: all 0.3s ease !important;
}

.faq-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grey-bg, #f4f4f4);
  border-radius: 50%;
  font-size: 1.2rem;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

.faq-item:hover .faq-icon {
  background: var(--blue, #406edf);
  color: white;
}

.faq-item.open .faq-icon {
  background: var(--blue, #406edf);
  color: white;
}

/* ==========================================================================
   10. FOOTER ENHANCEMENTS
   ========================================================================== */

.site-footer {
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold, #dfb140),
    var(--blue, #406edf),
    transparent
  );
}

.footer-social a {
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              color 0.3s ease !important;
}

.footer-social a:hover {
  transform: translateY(-4px) scale(1.1);
}

/* ==========================================================================
   11. SMOOTH SCROLLING & PAGE TRANSITIONS
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

/* Page load animation */
body {
  animation: pageLoad 0.6s ease-out;
}

@keyframes pageLoad {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   12. RESPONSIVE REFINEMENTS
   ========================================================================== */

@media (max-width: 768px) {
  .section-label::before {
    width: 24px;
  }
  
  .section-label {
    padding-left: 36px;
  }
  
  [data-animate] {
    transform: translateY(30px);
  }
  
  .hero-image {
    animation: none;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  [data-animate] {
    opacity: 1;
    transform: none;
  }
  
  .hero-image {
    animation: none;
  }
}

/* ==========================================================================
   13. CURSOR EFFECTS (subtle)
   ========================================================================== */

.btn-primary,
.btn-gold,
.btn-nav,
.transform-card,
.video-thumb {
  cursor: pointer;
}

/* ==========================================================================
   14. IMAGE ENHANCEMENTS
   ========================================================================== */

.hero-image img,
.about-image img,
.transform-img img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-image:hover img {
  transform: scale(1.03);
}

.transform-card:hover .transform-img img {
  transform: scale(1.05);
}

/* Image loading skeleton */
.hero-image,
.about-image,
.transform-img {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.hero-image img,
.about-image img {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   15. MOBILE POLISH — safe areas, touch, performance
   ========================================================================== */

@media (max-width: 768px) {
  html {
    -webkit-tap-highlight-color: rgba(64, 110, 223, 0.12);
  }

  /* Notch / home indicator — header & drawer */
  header,
  .site-header {
    padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(16px, env(safe-area-inset-right, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    min-height: calc(64px + env(safe-area-inset-top, 0px)) !important;
    height: auto !important;
    align-items: center !important;
  }

  .nav-overlay {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  nav.open,
  .main-nav.open {
    padding-top: calc(88px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: max(32px, env(safe-area-inset-bottom, 0px)) !important;
  }

  nav a,
  .main-nav a {
    min-height: 48px;
    display: flex !important;
    align-items: center !important;
  }

  .nav-toggle {
    margin-right: max(0px, env(safe-area-inset-right, 0px));
  }

  /* Shorter wordmark on narrow phones */
  @media (max-width: 400px) {
    .logo-wordmark {
      font-size: 0.95rem !important;
      letter-spacing: 0.02em !important;
    }
    .logo img {
      height: 40px !important;
    }
  }

  /* Stop shimmer behind photos — looks like flicker on OLED */
  .hero-image,
  .about-image,
  .transform-img {
    animation: none !important;
    background: #f0f0f0;
  }

  /* Primary CTA — full width on small screens for easier tapping */
  .hero .btn-primary,
  .struggles-cta .btn-primary,
  .programs-cta .btn-primary {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    min-height: 48px;
    display: inline-flex;
  }

  .gift-form {
    flex-direction: column;
  }

  .gift-form input {
    min-width: 0 !important;
    width: 100%;
    min-height: 48px;
  }

  .btn-gold {
    min-height: 48px;
    width: 100%;
  }

  /* FAQ — larger tap targets */
  .faq-q {
    min-height: 52px;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
    align-items: center !important;
  }

  .faq-icon {
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
  }

  /* Reduce motion-heavy shadows on mobile for smoother scroll */
  .feature-card:hover,
  .program-card:hover,
  .transform-card:hover {
    transform: translateY(-4px) !important;
  }

  .filter-btn {
    min-height: 44px;
    padding: 10px 20px;
    touch-action: manipulation;
  }

  .btn-primary,
  .btn-gold,
  .btn-nav,
  .form-submit,
  .apply-submit {
    touch-action: manipulation;
  }
}

/* Touch devices: no hover-only assumptions */
@media (hover: none) {
  .faq-item:hover {
    background: transparent;
  }

  .hero-image:hover img,
  .transform-card:hover .transform-img img {
    transform: none;
  }
}
