/**
 * Enhanced Counter Section
 * Modern card-based statistics with animations
 * Optimized for clean, professional look
 */

#counter {
    background: #ffffff;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* Subtle decorative pattern */
#counter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(52, 152, 219, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(52, 152, 219, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* Section title styling */
#counter .section-title-stats {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

#counter .section-title-stats::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    margin: 15px auto 0;
    border-radius: 2px;
}

.counting {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: default;
    margin-bottom: 30px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Colored top border accent */
.counting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.counting:nth-child(1)::after {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.counting:nth-child(2)::after {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.counting:nth-child(3)::after {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.counting:nth-child(4)::after {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

/* Subtle background overlay on hover */
.counting::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(52, 152, 219, 0.03) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.counting:hover::before {
    opacity: 1;
}

.counting:hover::after {
    opacity: 1;
}

.counting:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.12);
    border-color: rgba(52, 152, 219, 0.1);
}

/* Icon Styling */
.counting .icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

/* Icon glow effect */
.counting .icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.3s ease;
}

.counting:hover .icon {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.counting:hover .icon::before {
    opacity: 0.3;
}

.counting .icon i {
    font-size: 40px;
    color: white;
}

/* Different gradient for each card */
.counting:nth-child(1) .icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
}

.counting:nth-child(2) .icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 20px rgba(240, 147, 251, 0.25);
}

.counting:nth-child(3) .icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.25);
}

.counting:nth-child(4) .icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 8px 20px rgba(67, 233, 123, 0.25);
}

/* Hover shadows for each card */
.counting:nth-child(1):hover .icon {
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.counting:nth-child(2):hover .icon {
    box-shadow: 0 12px 30px rgba(240, 147, 251, 0.4);
}

.counting:nth-child(3):hover .icon {
    box-shadow: 0 12px 30px rgba(79, 172, 254, 0.4);
}

.counting:nth-child(4):hover .icon {
    box-shadow: 0 12px 30px rgba(67, 233, 123, 0.4);
}

/* Description */
.counting .desc {
    position: relative;
    z-index: 1;
}

.counting .desc h2 {
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.counting .desc h1.counter {
    font-size: 48px;
    font-weight: 800;
    color: #2c3e50;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}

/* Counter animation */
.counter {
    display: inline-block;
    transition: all 0.3s ease;
    color: #2c3e50; /* Default solid color */
    font-weight: 800;
}

/* Solid colors for each counter (NO GRADIENT - Fixed!) */
.counting:nth-child(1) .counter {
    color: #667eea !important;
}

.counting:nth-child(2) .counter {
    color: #f093fb !important;
}

.counting:nth-child(3) .counter {
    color: #4facfe !important;
}

.counting:nth-child(4) .counter {
    color: #43e97b !important;
}

.counting:hover .counter {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 991px) {
    #counter {
        padding: 60px 0;
    }

    #counter .section-title-stats {
        font-size: 28px;
        margin-bottom: 40px;
    }

    .counting {
        min-height: 190px;
        padding: 35px 15px;
    }

    .counting .icon {
        width: 75px;
        height: 75px;
    }

    .counting .icon i {
        font-size: 32px;
    }

    .counting .desc h1.counter {
        font-size: 40px;
    }

    .counting .desc h2 {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    #counter {
        padding: 50px 0;
    }

    #counter .section-title-stats {
        font-size: 24px;
        margin-bottom: 35px;
    }

    .counting {
        min-height: 170px;
        padding: 30px 15px;
        margin-bottom: 20px;
        border-radius: 15px;
    }

    .counting .icon {
        width: 70px;
        height: 70px;
        margin-bottom: 18px;
    }

    .counting .icon i {
        font-size: 28px;
    }

    .counting .desc h2 {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .counting .desc h1.counter {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    #counter {
        padding: 40px 0;
    }

    #counter .section-title-stats {
        font-size: 22px;
        margin-bottom: 30px;
    }

    .counting {
        min-height: 150px;
        padding: 25px 10px;
        border-radius: 12px;
    }

    .counting .icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .counting .icon i {
        font-size: 24px;
    }

    .counting .desc h2 {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .counting .desc h1.counter {
        font-size: 32px;
    }
}

/* Loading animation for counters */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counting {
    animation: fadeInUp 0.6s ease-out;
}

.counting:nth-child(1) { animation-delay: 0.1s; }
.counting:nth-child(2) { animation-delay: 0.2s; }
.counting:nth-child(3) { animation-delay: 0.3s; }
.counting:nth-child(4) { animation-delay: 0.4s; }

/* Pulse animation on load */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.counter.counting-animation {
    animation: pulse 0.5s ease-in-out;
}
