/* ============================================
   GYM-ROBOT-WARRIOR - ANIMATIONS
   Advanced Cyberpunk Animation System
   ============================================ */

/* ===== KEYFRAME ANIMATIONS ===== */

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

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

@keyframes float {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    25% { transform: translateY(calc(-50% - 10px)) translateX(5px); }
    50% { transform: translateY(calc(-50% + 5px)) translateX(-3px); }
    75% { transform: translateY(calc(-50% - 5px)) translateX(8px); }
}

@keyframes glitch1 {
    0% { clip-path: inset(20% 0 60% 0); transform: translate(2px, -2px); }
    20% { clip-path: inset(50% 0 20% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(10% 0 70% 0); transform: translate(1px, -1px); }
    60% { clip-path: inset(70% 0 10% 0); transform: translate(-1px, 1px); }
    80% { clip-path: inset(30% 0 40% 0); transform: translate(2px, 0); }
    100% { clip-path: inset(0% 0 80% 0); transform: translate(0); }
}

@keyframes glitch2 {
    0% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 2px); }
    20% { clip-path: inset(20% 0 50% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(70% 0 10% 0); transform: translate(-1px, 1px); }
    60% { clip-path: inset(10% 0 70% 0); transform: translate(1px, -1px); }
    80% { clip-path: inset(40% 0 30% 0); transform: translate(0, 2px); }
    100% { clip-path: inset(80% 0 0% 0); transform: translate(0); }
}

@keyframes glitchText {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.8; transform: translate(1px, 0); }
    97% { opacity: 1; transform: translate(-1px, 0); }
    98% { opacity: 0.9; transform: translate(0, 1px); }
    99% { opacity: 1; transform: translate(0, 0); }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--cyan); }
}

@keyframes logoGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.5), 0 0 60px rgba(0, 240, 255, 0.2); }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

@keyframes scanLine {
    0% { top: 0; opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes btnShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes underlineGlow {
    0% { left: -20px; }
    100% { left: 100%; }
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

.cyber-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%
    );
    transform: rotate(0deg);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.cyber-btn:hover::after {
    transform: rotate(180deg);
}

/* Card hover glow effect */
.facility-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.03), transparent, rgba(255, 0, 64, 0.03));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 16px;
    z-index: 1;
}

.facility-card:hover::before {
    opacity: 1;
}

/* Trainer card border animation */
.trainer-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--cyan), var(--purple), var(--red), var(--cyan));
    background-size: 400% 400%;
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trainer-card:hover::before {
    opacity: 1;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Pricing card shine */
.pricing-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.03), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.pricing-card:hover::after {
    left: 100%;
}

/* ===== STAGGERED ANIMATIONS ===== */
.facilities-grid .facility-card:nth-child(1) { transition-delay: 0.1s; }
.facilities-grid .facility-card:nth-child(2) { transition-delay: 0.2s; }
.facilities-grid .facility-card:nth-child(3) { transition-delay: 0.3s; }
.facilities-grid .facility-card:nth-child(4) { transition-delay: 0.4s; }
.facilities-grid .facility-card:nth-child(5) { transition-delay: 0.5s; }
.facilities-grid .facility-card:nth-child(6) { transition-delay: 0.6s; }

.pricing-grid .pricing-card:nth-child(1) { transition-delay: 0.1s; }
.pricing-grid .pricing-card:nth-child(2) { transition-delay: 0.2s; }
.pricing-grid .pricing-card:nth-child(3) { transition-delay: 0.3s; }
.pricing-grid .pricing-card:nth-child(4) { transition-delay: 0.4s; }

.trainers-grid .trainer-card:nth-child(1) { transition-delay: 0.1s; }
.trainers-grid .trainer-card:nth-child(2) { transition-delay: 0.2s; }
.trainers-grid .trainer-card:nth-child(3) { transition-delay: 0.3s; }

/* ===== NEON TEXT FLICKER ===== */
@keyframes neonFlicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
        opacity: 1;
        text-shadow: 0 0 10px var(--cyan-glow), 0 0 20px var(--cyan-glow);
    }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
        opacity: 0.5;
        text-shadow: none;
    }
}

/* ===== LOADING DOTS ===== */
@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* ===== SMOOTH SCROLL INDICATOR ===== */
@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(8px); }
    60% { transform: translateY(4px); }
}

/* ===== RIPPLE EFFECT ===== */
.cyber-btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== DATA HUD EFFECT ===== */
@keyframes dataStream {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-20px); opacity: 0; }
}

/* ===== CYBER GRID PATTERN ===== */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(0, 240, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 0, 64, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.section > .container {
    position: relative;
    z-index: 1;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.animate-on-scroll,
.facility-card,
.pricing-card,
.trainer-card {
    will-change: transform, opacity;
}

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