/* Stats Section with Green Gradient and Beautiful Waves - OPTIMIZED */
.stats-section {
    position: relative;
    margin-top: 0;
    padding-top: 50px;
    min-height: 500px;
    background: linear-gradient(135deg, #0f5132 0%, #065f46 25%, #047857 50%, #059669 75%, #10b981 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Promote to own layer for better rendering */
    will-change: transform;
}

/* Canvas Particle Background */
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: auto;
    /* GPU acceleration */
    will-change: transform;
}

/* Wave Background - OPTIMIZED */
.wave-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.waves {
    position: relative;
    width: 100%;
    height: 100%;
    margin-bottom: -7px;
}

/* Reduced animation complexity */
.wave-parallax>use {
    animation: move-forever 25s linear infinite;
}

.wave-parallax>use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 7s;
}

.wave-parallax>use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 10s;
}

.wave-parallax>use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 13s;
}

.wave-parallax>use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 20s;
}

/* Optimized keyframes with translate3d for GPU */
@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }

    100% {
        transform: translate3d(85px, 0, 0);
    }
}

/* Floating Particles - OPTIMIZED */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
}

/* Particle Canvas */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Optimized particle animations */
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    animation: float 6s ease-in-out infinite;
    /* GPU acceleration */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Optimized float animation */
@keyframes float {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 0.7;
    }

    50% {
        transform: translate3d(0, -20px, 0) rotate(180deg);
        opacity: 1;
    }
}

/* Cursor interaction effect - simplified */
.floating-particles:hover .particle {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-particles .particle.particle-active {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.9);
}

/* Optimized burst animation */
@keyframes burst {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.particle-burst {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: burst 0.6s ease-out forwards;
    pointer-events: none;
}

/* Optimized ripple effect */
@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s linear forwards;
    pointer-events: none;
}

/* Stats Container (Centered, Full Width) */
.stats-container {
    position: absolute;
    z-index: 3;
    width: 50%;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

.stats-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 120px;
    /* Entrance animation - hidden by default */
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    /* GPU acceleration */
    will-change: transform, opacity;
}

/* Stat item animated state - optimized */
.stat-item.animated {
    animation: statItemFadeIn 0.5s ease forwards;
}

/* Reduced staggered animation delays */
.stats-column:nth-child(1) .stat-item {
    animation-delay: 0.05s;
}

.stats-column:nth-child(2) .stat-item {
    animation-delay: 0.1s;
}

.stats-column:nth-child(3) .stat-item {
    animation-delay: 0.15s;
}

.stats-column:nth-child(4) .stat-item {
    animation-delay: 0.2s;
}

/* Counter pulse effect on complete - simplified */
.counter.count-complete {
    animation: counterPulse 0.3s ease;
}

/* Optimized keyframes with translate3d */
@keyframes statItemFadeIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes counterPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.stat-item:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.stat-number {
    margin-bottom: 8px;
}

.stat-number .counter {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    display: block;
    line-height: 1;
    background: linear-gradient(45deg, #ffffff, #f0f9ff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f9ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-item {
        min-height: 100px;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .stats-section {
        min-height: 350px;
        padding: 30px 0;
        margin-top: 0;
    }

    .stats-container {
        padding: 30px 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stats-column {
        gap: 10px;
    }

    .stat-item {
        padding: 12px;
        min-height: 80px;
    }

    .stat-number .counter {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .stats-section {
        min-height: 300px;
        margin-top: 0;
    }

    .stats-container {
        padding: 25px 10px;
    }

    .stat-item {
        padding: 10px;
        border-radius: 12px;
        min-height: 70px;
    }

    .stat-number .counter {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }
}

@media (max-width: 480px) {
    .stats-section {
        min-height: 250px;
    }

    .stat-item {
        min-height: 60px;
    }

    .stat-number .counter {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}