/* ===================================
   PIONEERSX - ANIMATIONS STYLESHEET
   ================================== */

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

/* Glowing Effect */
@keyframes glowPulse {
    0%, 100% { 
        text-shadow: 0 0 10px var(--primary-red), 
                     0 0 20px var(--primary-red), 
                     0 0 30px var(--primary-red); 
    }
    50% { 
        text-shadow: 0 0 20px var(--primary-red), 
                     0 0 30px var(--primary-red), 
                     0 0 40px var(--primary-red); 
    }
}

/* Rotation Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Spinner Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(37, 211, 102, 0);
    }
}

/* Sparkle Animation */
@keyframes sparkle {
    0% { 
        transform: rotate(0deg) scale(1); 
        opacity: 0.6; 
    }
    25% { 
        opacity: 0.8; 
    }
    50% { 
        transform: rotate(180deg) scale(1.1); 
        opacity: 1; 
    }
    75% { 
        opacity: 0.7; 
    }
    100% { 
        transform: rotate(360deg) scale(1); 
        opacity: 0.6; 
    }
}

/* Glitter Animation */
@keyframes glitter {
    0% { 
        transform: rotate(0deg) translateX(-50%); 
    }
    100% { 
        transform: rotate(360deg) translateX(-50%); 
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   SCROLL ANIMATIONS
   ================================== */

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide In Left Animation */
.slide-in-left {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide In Right Animation */
.slide-in-right {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale In Animation */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ===================================
   HERO SECTION ANIMATIONS
   ================================== */
.hero-content .fade-in {
    animation: fadeInUp 1s ease;
}

.hero-content .fade-in:nth-child(1) {
    animation-delay: 0.2s;
}

.hero-content .fade-in:nth-child(2) {
    animation-delay: 0.4s;
}

.hero-content .fade-in:nth-child(3) {
    animation-delay: 0.6s;
}

.hero-content .fade-in:nth-child(4) {
    animation-delay: 0.8s;
}

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

/* Service Card Hover */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Medical Card Hover */
.medical-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.medical-card:hover {
    transform: translateY(-10px) rotate(-1deg);
}

/* Team Card Hover */
.team-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-card:hover {
    transform: translateY(-10px) scale(1.05);
}

.team-card:hover .team-avatar {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(255, 30, 30, 0.4);
}

/* ===================================
   BUTTON ANIMATIONS
   ================================== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.95);
}

/* ===================================
   ICON ANIMATIONS
   ================================== */

/* Service Icon Bounce */
.service-card:hover .service-icon {
    animation: iconBounce 0.6s ease;
}

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

/* Medical Icon Pulse */
.medical-card:hover .medical-icon {
    animation: iconPulse 0.6s ease;
}

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

/* Process Icon Rotate */
.process-step:hover .process-icon {
    animation: iconRotate 0.6s ease;
}

@keyframes iconRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================
   LOADING ANIMATIONS
   ================================== */

/* Loader Fade Out */
.loader {
    animation: fadeOut 0.5s ease 1s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Spinner Rotation */
.loader-spinner {
    animation: spin 1s linear infinite;
}

/* ===================================
   NUMBER COUNTER ANIMATION
   ================================== */
.stat-number {
    display: inline-block;
    transition: all 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
    text-shadow: 0 0 20px var(--primary-red);
}

/* ===================================
   TEXT ANIMATIONS
   ================================== */

/* Typing Effect for Hero */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary-red), var(--secondary-blue), var(--primary-red));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

/* ===================================
   FORM ANIMATIONS
   ================================== */

/* Input Focus Animation */
.form-group input:focus,
.form-group textarea:focus {
    animation: inputGlow 0.3s ease;
}

@keyframes inputGlow {
    0% { box-shadow: 0 0 0 0 rgba(255, 30, 30, 0.4); }
    100% { box-shadow: 0 0 10px rgba(255, 30, 30, 0.2); }
}

/* Label Float Animation */
.form-group label {
    transition: all 0.3s ease;
}

.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    transform: translateY(-25px);
    font-size: 0.9rem;
    color: var(--primary-red);
}

/* ===================================
   NAVIGATION ANIMATIONS
   ================================== */

/* Nav Link Hover */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu Animation */
.nav-links {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links.active {
    animation: slideDown 0.3s ease;
}

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

/* ===================================
   SCROLL INDICATORS
   ================================== */

/* Scroll Down Indicator */
@keyframes scrollDown {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(10px); opacity: 1; }
}

.scroll-indicator {
    animation: scrollDown 2s ease infinite;
}

/* ===================================
   BACKGROUND ANIMATIONS
   ================================== */

/* Floating Particles */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.floating:nth-child(2) {
    animation-delay: 2s;
}

.floating:nth-child(3) {
    animation-delay: 4s;
}

/* Wave Animation */
@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.wave-bg {
    animation: wave 20s linear infinite;
}

/* ===================================
   STAGGERED ANIMATIONS
   ================================== */

/* Stagger Children Animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   ================================== */

/* GPU Acceleration for Smooth Animations */
.service-card,
.medical-card,
.team-card,
.testimonial,
.case-study,
.btn {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

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