/* ===================================
   GYM-ELION-WARRIOR - Animations
   =================================== */

/* --- Scroll Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* --- Particle Animation --- */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 6s infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 0.6;
        transform: translateY(-20px) scale(1);
    }
    90% {
        opacity: 0.1;
    }
    100% {
        opacity: 0;
        transform: translateY(-400px) scale(0);
    }
}

/* --- Glitch Effect for Title --- */
.hero-title .title-highlight {
    position: relative;
}

/* --- Pulse glow for featured card --- */
.pricing-card.featured {
    animation: featuredGlow 3s ease-in-out infinite;
}

@keyframes featuredGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(255, 77, 0, 0);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 77, 0, 0.15);
    }
}

/* --- Card hover shine --- */
.facility-card::after,
.class-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.03),
        transparent
    );
    transition: 0.5s;
    pointer-events: none;
}

.facility-card:hover::after,
.class-card:hover::after {
    left: 100%;
}

.facility-card,
.class-card {
    position: relative;
    overflow: hidden;
}

/* --- Stats counter animation --- */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Nav link hover underline --- */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 20px;
}

.nav-link.active::before {
    width: 0;
}

/* --- Smooth image loading --- */
img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.loaded,
img[src] {
    opacity: 1;
}

/* --- Button ripple effect --- */
.pricing-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.2) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.pricing-btn:active::after {
    transform: scale(0);
    opacity: 0.3;
    transition: 0s;
}

.pricing-btn {
    position: relative;
    overflow: hidden;
}

/* --- Schedule item entrance animation --- */
.schedule-item {
    animation: slideInLeft 0.3s ease-out;
}

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

.schedule-item:nth-child(1) { animation-delay: 0s; }
.schedule-item:nth-child(2) { animation-delay: 0.05s; }
.schedule-item:nth-child(3) { animation-delay: 0.1s; }
.schedule-item:nth-child(4) { animation-delay: 0.15s; }
.schedule-item:nth-child(5) { animation-delay: 0.2s; }
.schedule-item:nth-child(6) { animation-delay: 0.25s; }
.schedule-item:nth-child(7) { animation-delay: 0.3s; }

/* --- Success animation for form --- */
@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.form-success {
    animation: successPop 0.5s ease;
    text-align: center;
    padding: 40px;
}

.form-success i {
    font-size: 3rem;
    color: #25d366;
    margin-bottom: 16px;
}

.form-success h3 {
    color: var(--white);
    margin-bottom: 8px;
}

.form-success p {
    color: var(--gray-400);
}

/* --- Gradient border animation for Elite card --- */
.pricing-card.elite {
    position: relative;
}

.pricing-card.elite::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,215,0,0.3), transparent, rgba(255,215,0,0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* --- Loading skeleton --- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--dark-600) 25%,
        var(--dark-500) 50%,
        var(--dark-600) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
