/* ============================================================
   animation.css | Life Coach Szczecin
   Custom animations & AOS-compatible classes
   ============================================================ */

/* ── AOS INIT OVERRIDES ── */
[data-aos] {
  pointer-events: none;
}

[data-aos].aos-animate {
  pointer-events: auto;
}

/* ── CUSTOM KEYFRAMES ── */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lineGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

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

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

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── PAGE LOAD ANIMATIONS ── */
.animate-hero-eyebrow {
  animation: fadeInLeft 0.7s cubic-bezier(0,0,0.2,1) 0.2s both;
}

.animate-hero-title {
  animation: fadeInUp 0.8s cubic-bezier(0,0,0.2,1) 0.35s both;
}

.animate-hero-subtitle {
  animation: fadeInUp 0.7s cubic-bezier(0,0,0.2,1) 0.5s both;
}

.animate-hero-actions {
  animation: fadeInUp 0.7s cubic-bezier(0,0,0.2,1) 0.65s both;
}

.animate-hero-trust {
  animation: fadeInUp 0.7s cubic-bezier(0,0,0.2,1) 0.8s both;
}

.animate-hero-visual {
  animation: fadeInRight 0.9s cubic-bezier(0,0,0.2,1) 0.4s both;
}

.animate-hero-card-1 {
  animation: fadeInLeft 0.7s cubic-bezier(0,0,0.2,1) 0.9s both;
}

.animate-hero-card-2 {
  animation: fadeInRight 0.7s cubic-bezier(0,0,0.2,1) 1.1s both;
}

/* ── SCROLL TRIGGER CLASSES (used by animation.js) ── */
.reveal {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0,0,0.2,1),
              transform 0.7s cubic-bezier(0,0,0.2,1);
}

.reveal.reveal-up {
  transform: translateY(32px);
}

.reveal.reveal-left {
  transform: translateX(-32px);
}

.reveal.reveal-right {
  transform: translateX(32px);
}

.reveal.reveal-scale {
  transform: scale(0.93);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children .reveal:nth-child(2) { transition-delay: 80ms; }
.stagger-children .reveal:nth-child(3) { transition-delay: 160ms; }
.stagger-children .reveal:nth-child(4) { transition-delay: 240ms; }
.stagger-children .reveal:nth-child(5) { transition-delay: 320ms; }
.stagger-children .reveal:nth-child(6) { transition-delay: 400ms; }

/* ── FLOATING CARDS (hero decorative) ── */
.hero-card {
  animation: slideDown 0.6s cubic-bezier(0,0,0.2,1) both;
}

.hero-card:nth-child(1) { animation-delay: 1s; }
.hero-card:nth-child(2) { animation-delay: 1.2s; }

/* ── TRUST BAR MARQUEE ── */
.trust-bar-inner {
  will-change: transform;
}

/* ── COUNTER ANIMATION TARGET ── */
.stat-number[data-target] {
  animation: countUp 0.6s cubic-bezier(0,0,0.2,1) both;
}

/* ── DIVIDER LINE ANIMATION ── */
.divider-gold {
  animation: none; /* controlled by JS intersection observer */
  transform-origin: left center;
}

.divider-gold.animated {
  animation: lineGrow 0.6s cubic-bezier(0,0,0.2,1) both;
}

/* ── BUTTON HOVER EFFECTS ── */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  transform: translateX(-100%) skewX(-15deg);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover::after {
  transform: translateX(100%) skewX(-15deg);
}

/* ── CARD HOVER LIFT ── */
.service-card,
.package-card,
.review-card,
.blog-card {
  will-change: transform;
}

/* ── GOLD SHIMMER on featured ── */
.package-card.featured::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(196,163,90,0.06),
    transparent
  );
  transform: skewX(-15deg);
  pointer-events: none;
}

.package-card.featured:hover::after {
  animation: shimmer 0.8s ease forwards;
}

/* ── FAQ TRANSITION ── */
.faq-answer {
  will-change: max-height;
}

/* ── PROGRESS BAR (page load) ── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #E8C87A);
  z-index: 9999;
  width: 0%;
  transition: width 0.2s ease;
  transform-origin: left center;
}

/* ── SCROLL INDICATOR ── */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  animation: float 2.5s ease-in-out infinite;
  z-index: 1;
}

.scroll-indicator span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.scroll-indicator svg {
  color: var(--accent);
  animation: float 2s ease-in-out infinite;
}

/* ── FOCUS STYLES (accessibility) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ── SELECTION ── */
::selection {
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* ── LOADING SKELETON (for images) ── */
.img-skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--accent-light) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── MOBILE: disable heavy animations ── */
@media (max-width: 768px) {
  .hero-card-1,
  .hero-card-2 { animation: none; }

  .reveal {
    transition-duration: 0.5s;
  }
}

/* ── REDUCED MOTION: all off ── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .animate-hero-eyebrow,
  .animate-hero-title,
  .animate-hero-subtitle,
  .animate-hero-actions,
  .animate-hero-trust,
  .animate-hero-visual,
  .animate-hero-card-1,
  .animate-hero-card-2 {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
