/* Counter Section V2 - Design ultra-moderne avec animations 3D */
.counter-section-v2 {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(125deg, #060c21, #0d1f3c);
    overflow: hidden;
    z-index: 1;
}

/* Overlay Effect */
.counter-glow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(36, 97, 219, 0.15) 0%, transparent 70%);
    z-index: -1;
}

/* 3D Scene container */
.counter-3d-scene {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    perspective: 1000px;
}

/* Section Title with dramatic style */
.counter-section-title-v2 {
    text-align: center;
    margin-bottom: 70px;
    position: relative;
}

.counter-section-title-v2 h2 {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.counter-section-title-v2 h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4facfe, #00f2fe, transparent);
    animation: gradient-flow 3s infinite linear;
}

.counter-section-title-v2 p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Counter container */
.counter-grid-v2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    perspective: 1000px;
}

/* Modern Counter Box */
.counter-box-v2 {
    flex: 0 0 calc(25% - 30px);
    margin: 15px;
    position: relative;
    height: 250px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateZ(0px);    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.counter-box-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(225deg, #00f2fe, #4facfe, #9333ea);    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0.7;
}

.counter-box-v2::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: rotate(30deg);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.counter-box-v2:hover {
    transform: translateY(-10px) translateZ(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.counter-box-v2:hover::after {
    opacity: 1;
}

/* Counter Icon */
.counter-icon-v2 {
    position: relative;
    margin-bottom: 25px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.counter-icon-v2 svg {
    width: 50px;
    height: 50px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px rgba(79, 172, 254, 0.7));
    transition: all 0.5s ease;
}

.counter-box-v2:hover .counter-icon-v2 svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(79, 172, 254, 0.9));
}

.counter-icon-v2::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.2), transparent);
    z-index: -1;
}

.counter-icon-bg {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(0, 242, 254, 0.1));
    border-radius: 15px;
    transform: rotate(45deg);
    z-index: -1;
    animation: rotate-slow 10s linear infinite;
}

/* Counter Number */
.counter-number-v2 {
    font-size: 52px;
    font-weight: 800;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    margin-bottom: 10px;
    position: relative;
    display: inline-flex;
    align-items: center;
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.counter-number-v2 .counter-suffix {
    font-size: 28px;
    font-weight: 600;
    margin-left: 5px;
    background: linear-gradient(to right, #00f2fe, #9333ea);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.counter-number-v2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, rgba(79, 172, 254, 0.5), rgba(0, 242, 254, 0.5));
    border-radius: 3px;
}

/* Counter Label */
.counter-label-v2 {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* 3D Floating Elements */
.counter-floating-element {
    position: absolute;
    width: 80px;
    height: 80px;
    z-index: -1;
}

.counter-floating-circle {
    border: 2px solid rgba(79, 172, 254, 0.3);
    border-radius: 50%;
}

.counter-floating-square {
    border: 2px solid rgba(0, 242, 254, 0.3);
    transform: rotate(45deg);
}

.counter-floating-triangle {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 80px solid rgba(147, 51, 234, 0.1);
}

/* Glow Points */
.counter-glow-point {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4facfe;
    box-shadow: 0 0 10px 2px rgba(79, 172, 254, 0.8);
}

/* Animations */
@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-15px) rotate(5deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(15px) rotate(-5deg); }
}

@keyframes rotate-slow {
    0% { transform: rotate(45deg); }
    100% { transform: rotate(405deg); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; box-shadow: 0 0 5px 1px rgba(79, 172, 254, 0.5); }
    50% { opacity: 1; box-shadow: 0 0 15px 3px rgba(79, 172, 254, 1); }
}

/* Responsive Design */
@media (max-width: 1199px) {
    .counter-box-v2 {
        flex: 0 0 calc(50% - 30px);
    }
}

@media (max-width: 767px) {
    .counter-section-v2 {
        padding: 80px 0;
    }
    .counter-section-title-v2 h2 {
        font-size: 32px;
    }
    .counter-number-v2 {
        font-size: 42px;
    }
    .counter-box-v2 {
        flex: 0 0 calc(100% - 30px);
        height: 220px;
    }
}

@media (max-width: 480px) {
    .counter-section-title-v2 h2 {
        font-size: 28px;
    }
    .counter-section-title-v2 p {
        font-size: 16px;
    }
    .counter-number-v2 {
        font-size: 36px;
    }
    .counter-label-v2 {
        font-size: 16px;
    }
}

/* Specific animations for individual elements */
.counter-box-v2:nth-child(1) { animation-delay: 0.1s; }
.counter-box-v2:nth-child(2) { animation-delay: 0.3s; }
.counter-box-v2:nth-child(3) { animation-delay: 0.5s; }
.counter-box-v2:nth-child(4) { animation-delay: 0.7s; }
