/* Button Ripple Effect */
.cta-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1);
    transform-origin: 50% 50%;
}

.cta-button.ripple::after {
    animation: ripple 0.6s ease-out;
}

/* Enhanced Service Card Animations */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: opacity, transform, perspective;
    transform-style: preserve-3d;
    perspective: 1000px;
    background: var(--background);
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, rgba(37, 99, 235, 0.7), rgba(30, 64, 175, 0.7));
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
    animation: gradientFlow 3s linear infinite;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0) rotateY(0);
}

/* Service Card Icon Animation */
.service-card i {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.service-card:hover i {
    animation: iconBounce 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

/* Stagger delays for service cards */
.service-card:nth-child(1).visible { transition-delay: 0ms; }
.service-card:nth-child(2).visible { transition-delay: 200ms; }
.service-card:nth-child(3).visible { transition-delay: 400ms; }
.service-card:nth-child(4).visible { transition-delay: 600ms; }
.service-card:nth-child(5).visible { transition-delay: 800ms; }

/* Navigation Animations */
@keyframes menuReveal {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes linkReveal {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Navigation Hover Effects */
.nav-links {
    animation: menuReveal 0.6s ease forwards;
}

.nav-links li {
    opacity: 0;
    animation: linkReveal 0.5s ease forwards;
}

.nav-links li:nth-child(1) { animation-delay: 0.1s; }
.nav-links li:nth-child(2) { animation-delay: 0.2s; }
.nav-links li:nth-child(3) { animation-delay: 0.3s; }
.nav-links li:nth-child(4) { animation-delay: 0.4s; }
.nav-links li:nth-child(5) { animation-delay: 0.5s; }

.nav-links a {
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-links a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-links a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Scroll-triggered navbar animation */
.navbar {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

/* Section Heading Animations */
.section-heading {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Achievement Number Animations */
.achievements li span {
    opacity: 0;
    transform: translateY(10px);
    display: inline-block;
    animation: fadeInUp 0.8s ease forwards;
}

.achievements li:nth-child(1) span { animation-delay: 0.2s; }
.achievements li:nth-child(2) span { animation-delay: 0.4s; }
.achievements li:nth-child(3) span { animation-delay: 0.6s; }

.achievements li span.counting {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* About Section Animations */
.about-content {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.about-text {
    position: relative;
    animation: slideUp 1s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Team Member Animations */
.team-member {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.team-member.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for team members */
.team-member:nth-child(1).visible { transition-delay: 0ms; }
.team-member:nth-child(2).visible { transition-delay: 200ms; }
.team-member:nth-child(3).visible { transition-delay: 400ms; }
.team-member:nth-child(4).visible { transition-delay: 600ms; }

.team-member:hover {
    transform: translateY(-10px);
}

.member-image:hover {
    transform: scale(1.05);
    border-color: white;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.4);
}

/* Contact Info Hover Effects */
.info-item:hover {
    transform: translateX(10px);
    background-color: rgba(37, 99, 235, 0.1);
}

.info-item:hover i {
    transform: scale(1.2);
    color: var(--secondary-color);
}

/* New Keyframe Animations */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.1) translateY(0); }
    50% { transform: scale(1.2) translateY(-10px); }
}

/* Existing Keyframe Animations */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Parallax Effects */
.parallax-section {
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;
    overflow: hidden;
    min-height: 100vh;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: -10%;
    width: 120%;
    height: 140%;
    background-size: cover;
    background-position: center;
    transform: translateZ(-15px) scale(2.5);
    z-index: -1;
    will-change: transform;
    transition: transform 0.1s linear;
}

.parallax-section .container {
    position: relative;
    transform: translateZ(0);
    z-index: 1;
    width: 100%;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Hero Animations */
.hero h1 {
    animation: fadeInUp 1s ease;
    transform: translateZ(5px) scale(0.95);
    will-change: transform;
}

.hero p {
    animation: fadeInUp 1s ease 0.2s;
    transform: translateZ(3px) scale(0.97);
    will-change: transform;
}

.hero .cta-button {
    animation: fadeInUp 1s ease 0.4s;
    transform: translateZ(8px) scale(0.92);
    will-change: transform;
}

/* About Section Parallax */
.about.parallax-section .about-content {
    transform: translateZ(4px) scale(0.96);
    will-change: transform;
}

.about.parallax-section .achievements {
    transform: translateZ(6px) scale(0.94);
    will-change: transform;
}

/* Accessibility - Disable parallax for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .parallax-section,
    .parallax-bg,
    .parallax-section .container,
    .hero h1,
    .hero p,
    .hero .cta-button,
    .about.parallax-section .about-content,
    .about.parallax-section .achievements {
        transform: none !important;
        will-change: auto;
    }
}

/* Loading Spinner Animation */
.loading-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
}

.loading-spinner.show {
    display: block;
}

/* Form Success Animation */
.form-success {
    animation: fadeIn 0.5s ease;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .service-card,
    .achievements li span,
    .team-member {
        opacity: 1;
        transform: none;
        transition: none;
    }
}