/* Enhanced Stats Section Styles */
.stats-section {
    background: linear-gradient(135deg, #f0f4f8 0%, #e7f0ff 100%);
    padding: 4rem 0 2.5rem;
    position: relative;
    overflow: hidden;
    color: var(--dark-color);
}

.stats-section .section-title {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.stats-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #0d6efd, #4361ee);
    border-radius: 2px;
}

.stats-section .section-subtitle {
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
}

.stats-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.stats-section .row {
    margin-left: -15px;
    margin-right: -15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.stats-section::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.02) 70%);
    top: -200px;
    left: -200px;
    z-index: 0;
    animation: float-slow 15s infinite alternate ease-in-out;
}

.stats-section::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.08) 0%, rgba(13, 110, 253, 0.01) 70%);
    bottom: -250px;
    right: -250px;
    z-index: 0;
    animation: float-slow 20s infinite alternate-reverse ease-in-out;
}

@keyframes float-slow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, 20px) scale(1.05);
    }
    100% {
        transform: translate(-20px, 10px) scale(0.95);
    }
}

/* Old stat-card styles removed in favor of unified-stat-card */

.stat-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(67, 97, 238, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.8rem;
    position: relative;
    transition: all 0.5s ease;
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255, 255, 255, 0.3), transparent 30%);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(1turn);
    }
}

.stat-icon i {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #0d6efd, #4361ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: all 0.5s ease;
    filter: drop-shadow(0 2px 3px rgba(13, 110, 253, 0.2));
}

.stat-item:hover .stat-icon {
    transform: rotateY(180deg) scale(1.1);
    background: linear-gradient(135deg, #0d6efd, #4361ee);
    box-shadow: 0 15px 30px rgba(13, 110, 253, 0.2);
}

.stat-item:hover .stat-icon i {
    transform: rotateY(180deg);
    background: white;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    line-height: 1.1;
    background: linear-gradient(to right, #0d6efd, #4361ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: all 0.5s ease;
    display: inline-block;
    min-height: 65px; /* Ensures consistent height during animation */
    width: 100%; /* Ensures the number takes full width of the card */
    text-align: center; /* Centers the text */
    letter-spacing: -1px;
    text-shadow: 3px 3px 6px rgba(13, 110, 253, 0.1);
}

/* Animation for counting effect */
.stat-item.counting .stat-number {
    animation: pulse-count 0.5s infinite alternate;
}

.stat-item.counted .stat-number {
    animation: scale-in 0.5s forwards;
}

/* Style for 'lacs+' text */
.stat-number::after {
    content: attr(data-suffix);
    display: inline;
    background: linear-gradient(to right, #0d6efd, #4361ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 800;
    font-size: 0.9em;
}

@keyframes pulse-count {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

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

.stat-item:hover .stat-number {
    transform: scale(1.1);
    background: linear-gradient(to right, #0052cc, #3a4cd7);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 4px 4px 8px rgba(13, 110, 253, 0.15);
}

.stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    margin-top: 0.8rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.stat-item:hover .stat-label {
    color: #495057;
}

.stat-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, rgba(13, 110, 253, 0.3), rgba(67, 97, 238, 0.3));
    border-radius: 3px;
    transition: all 0.3s ease;
}

.stat-item:hover .stat-label::after {
    width: 60px;
    background: linear-gradient(to right, rgba(13, 110, 253, 0.8), rgba(67, 97, 238, 0.8));
}

/* Animation for the stats section */
.stats-section .row {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out forwards;
    margin-bottom: 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Unified stat card styles */
.unified-stat-card {
    background: linear-gradient(145deg, #ffffff, #f8faff);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 15px 35px rgba(13, 110, 253, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: float-card 6s ease-in-out infinite alternate;
}

.unified-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(67, 97, 238, 0.04) 100%);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
    border-radius: 20px;
}

.unified-stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #0d6efd, #4361ee);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.unified-stat-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(13, 110, 253, 0.15), 0 0 15px rgba(13, 110, 253, 0.1);
    background: linear-gradient(145deg, #ffffff, #f0f7ff);
}

.unified-stat-card:hover::before {
    opacity: 1;
}

.unified-stat-card:hover::after {
    transform: scaleX(1);
}

/* Disable floating animation on mobile for better performance */
@media (max-width: 767px) {
    .unified-stat-card {
        animation: none;
    }
}

.stat-items-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stat-item {
    flex: 1;
    min-width: 180px;
    padding: 0.8rem;
    text-align: center;
    position: relative;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(13, 110, 253, 0.2), transparent);
}

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

.unified-stat-card:hover {
    animation-play-state: paused;
}

/* Responsive styles */
@media (max-width: 991px) {
    .unified-stat-card {
        padding: 2rem 1.2rem;
    }

    .stat-items-container {
        gap: 1.2rem;
    }

    .stat-number {
        font-size: 3rem;
        min-height: 60px;
    }

    .stats-section .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .stat-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1.2rem;
    }

    .stat-item:not(:last-child)::after {
        height: 60%;
    }
}

@media (max-width: 767px) {
    .stats-section {
        padding: 3rem 0 1.5rem;
    }

    .stats-section .row {
        row-gap: 1.2rem !important;
    }

    .stats-section .section-title {
        font-size: 2rem;
    }

    .stats-section .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    .unified-stat-card {
        padding: 1.5rem 0.8rem;
        border-radius: 18px;
    }

    .stat-items-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stat-item {
        width: 100%;
        padding: 0.8rem 0.4rem;
    }

    .stat-item:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 0;
        bottom: -0.8rem;
        left: 0;
        top: auto;
        transform: none;
        height: 1px;
        width: 60%;
        margin: 0 auto;
        background: linear-gradient(to right, transparent, rgba(13, 110, 253, 0.2), transparent);
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .stat-icon i {
        font-size: 1.6rem;
    }

    .stat-number {
        font-size: 2.4rem;
        min-height: 50px;
    }

    .stat-label {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .stat-label::after {
        width: 30px;
        height: 2px;
    }
}

@media (max-width: 575px) {
    .stats-section {
        padding: 2rem 0 1rem;
    }

    .stats-section .row {
        row-gap: 1rem !important;
    }

    .stats-section .section-title {
        font-size: 1.6rem;
    }

    .stats-section .section-title::after {
        width: 50px;
        height: 3px;
        bottom: -4px;
    }

    .stats-section .section-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        max-width: 90%;
    }

    .unified-stat-card {
        padding: 1.2rem 0.8rem;
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(13, 110, 253, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8);
    }

    .stat-items-container {
        gap: 1rem;
    }

    .stat-item:not(:last-child)::after {
        width: 50%;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0.6rem;
        box-shadow: 0 6px 12px rgba(13, 110, 253, 0.08);
    }

    .stat-icon i {
        font-size: 1.3rem;
    }

    .stat-number {
        font-size: 1.8rem;
        min-height: 35px;
        margin-bottom: 0.2rem;
        letter-spacing: -0.5px;
    }

    .stat-label {
        font-size: 0.8rem;
        padding-bottom: 0.3rem;
        line-height: 1.2;
        max-width: 95%;
        margin-left: auto;
        margin-right: auto;
    }

    .stat-label::after {
        width: 25px;
        height: 2px;
    }

    .unified-stat-card:hover {
        transform: translateY(-5px);
    }

    /* Reduce bottom margin for better spacing */
    .py-5 {
        padding-bottom: 0.8rem !important;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .unified-stat-card {
        padding: 1rem 0.5rem;
    }

    .stat-items-container {
        gap: 0.8rem;
    }

    .stat-item {
        padding: 0.5rem 0.3rem;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        margin-bottom: 0.5rem;
    }

    .stat-icon i {
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 1.6rem;
        min-height: 30px;
    }

    .stat-label {
        font-size: 0.75rem;
        padding-bottom: 0.2rem;
    }

    .stats-section .section-title {
        font-size: 1.4rem;
    }

    .stats-section .section-subtitle {
        font-size: 0.8rem;
    }
}
