/* ============ ENTRANCE ANIMATIONS ============ */

/* Fade In animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Up with larger distance */
@keyframes slideUpLarge {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Left animation */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Right animation */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Text reveal animation */
@keyframes textReveal {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

/* ============ REVEAL ANIMATIONS ============ */

/* Base reveal animation for elements with data-reveal */
[data-reveal] {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
    animation-delay: var(--d, 0s);
}

[data-reveal].in {
    animation-play-state: running;
}

/* ============ SECTION TITLE ANIMATIONS ============ */

.sec-title {
    opacity: 0;
    animation: slideUpLarge 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.sec-title.in {
    animation-play-state: running;
}

.sec-title span {
    display: inline-block;
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.sec-title.in span {
    animation-play-state: running;
}

.sec-title span:nth-child(1) { animation-delay: 0.1s; }
.sec-title span:nth-child(2) { animation-delay: 0.2s; }
.sec-title span:nth-child(3) { animation-delay: 0.3s; }
.sec-title span:nth-child(4) { animation-delay: 0.4s; }
.sec-title span:nth-child(5) { animation-delay: 0.5s; }
.sec-title span:nth-child(6) { animation-delay: 0.6s; }

/* ============ SECTION CONTENT ANIMATIONS ============ */

/* What You'll Learn (Bento Grid) */
.bento-grid {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: 0.2s;
}

.bento-card {
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bento-card:nth-child(1) { animation-delay: 0.1s; }
.bento-card:nth-child(2) { animation-delay: 0.15s; }
.bento-card:nth-child(3) { animation-delay: 0.2s; }
.bento-card:nth-child(4) { animation-delay: 0.25s; }

/* About Section */
.trainer-card {
    opacity: 0;
    animation: slideLeft 0.7s ease-out forwards;
}

.stats {
    opacity: 0;
    animation: slideRight 0.7s ease-out forwards;
    animation-delay: 0.2s;
}

.stat {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
}

.stat:nth-child(1) { animation-delay: 0.3s; }
.stat:nth-child(2) { animation-delay: 0.4s; }
.stat:nth-child(3) { animation-delay: 0.5s; }
.stat:nth-child(4) { animation-delay: 0.6s; }

/* Timeline Section */
.tl-item {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.tl-item:nth-child(1) { animation-delay: 0.1s; }
.tl-item:nth-child(2) { animation-delay: 0.2s; }
.tl-item:nth-child(3) { animation-delay: 0.3s; }
.tl-item:nth-child(4) { animation-delay: 0.4s; }

/* FAQ Items */
.faq-item {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }

/* ============ CTA SECTION ANIMATIONS ============ */

.cta-panel {
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cta-chip {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
    animation-delay: 0.2s;
}

.cta-panel h2 {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

.cta-panel > p:first-of-type {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
    animation-delay: 0.4s;
}

.cta-panel button {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
    animation-delay: 0.5s;
}

/* ============ FOOTER ANIMATIONS ============ */

footer {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

.foot-grid > div {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.foot-grid > div:nth-child(1) { animation-delay: 0.1s; }
.foot-grid > div:nth-child(2) { animation-delay: 0.2s; }
.foot-grid > div:nth-child(3) { animation-delay: 0.3s; }
.foot-grid > div:nth-child(4) { animation-delay: 0.4s; }

/* ============ SCROLL-TRIGGERED ANIMATIONS ============ */

/* Elements trigger animation when they come into view */
[data-reveal] {
    will-change: opacity, transform;
}

.sec-title {
    will-change: opacity, transform;
}

.bento-card, .tl-item, .faq-item, .trainer-card, .stat {
    will-change: opacity, transform;
}

/* ============ STAGGER DELAY UTILITY ============ */

.stagger-delay-1 { --animation-delay: 0.1s; }
.stagger-delay-2 { --animation-delay: 0.2s; }
.stagger-delay-3 { --animation-delay: 0.3s; }
.stagger-delay-4 { --animation-delay: 0.4s; }
.stagger-delay-5 { --animation-delay: 0.5s; }

/* ============ SMOOTH HOVER ANIMATIONS ============ */

.bento-card,
.faq-item,
.stat,
.trainer-card {
    transition: all 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-8px);
}

.faq-item:hover {
    transform: translateX(4px);
}

.stat:hover {
    transform: scale(1.05);
}

.trainer-card:hover {
    transform: translateY(-6px);
}

/* ============ BUTTON ANIMATIONS ============ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transition: left 0.3s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.3);
}

/* ============ TEXT ANIMATION ============ */

.hero-title span,
.hero-subtitle span {
    display: inline-block;
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.hero-title span:nth-child(1) { animation-delay: 0.1s; }
.hero-title span:nth-child(2) { animation-delay: 0.2s; }
.hero-title span:nth-child(3) { animation-delay: 0.3s; }
.hero-subtitle { animation: slideUp 0.6s ease-out 0.4s forwards; }

/* ============ BOUNCE ANIMATION ============ */

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

.bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* ============ GLOW ANIMATION ============ */

@keyframes glow {
    0%, 100% {
        opacity: 0.5;
        box-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 40px rgba(88, 166, 255, 0.6);
    }
}

.trainer-glow {
    animation: glow 3s ease-in-out infinite;
}

/* ============ PULSE ANIMATION ============ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}
