/* Counters Section Styles */
.counters-section {
    position: relative;
    overflow: hidden;
}

.counters-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
    z-index: 0;
}

.counters-section .container {
    position: relative;
    z-index: 1;
}

.counters-row {
    margin-top: 30px;
}

.counter-card {
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 0;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    height: 220px;
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 8px solid rgba(16, 46, 80, 0.05); /* Primary color from admin dashboard */
}

.counter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(16, 46, 80, 0.03) 0%, rgba(245, 196, 94, 0.03) 100%);
    z-index: 0;
    transition: all 0.4s ease;
}

.counter-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #102e50 0%, #f5c45e 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0.3;
    transition: all 0.4s ease;
}

.counter-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.counter-card:hover::after {
    opacity: 0.8;
    border-width: 3px;
}

.counter-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #102e50 0%, #0e2540 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 8px 15px rgba(16, 46, 80, 0.3);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.counter-card:hover .counter-icon {
    transform: scale(1.15) rotate(10deg);
}

.counter-number {
    font-size: 42px;
    font-weight: 700;
    color: #102e50; /* Primary color from admin dashboard */
    margin-bottom: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.counter-suffix {
    font-size: 24px;
    margin-left: 3px;
    color: #f5c45e; /* Secondary color from admin dashboard */
}

.counter-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    max-width: 90%;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .counter-card {
        height: 200px;
        width: 200px;
    }

    .counter-icon {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .counter-number {
        font-size: 38px;
    }

    .counter-suffix {
        font-size: 22px;
    }

    .counter-title {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .counter-card {
        height: 180px;
        width: 180px;
        border-width: 6px;
    }

    .counter-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 12px;
    }

    .counter-number {
        font-size: 34px;
    }

    .counter-suffix {
        font-size: 18px;
    }

    .counter-title {
        font-size: 14px;
        padding: 0 15px;
    }
}

@media (max-width: 576px) {
    .counter-card {
        height: 160px;
        width: 160px;
        border-width: 5px;
        margin-bottom: 20px;
    }

    .counter-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        margin-bottom: 10px;
    }

    .counter-number {
        font-size: 30px;
    }

    .counter-suffix {
        font-size: 16px;
    }
}

/* Animation for counters */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes glow {
    0% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 15px 40px rgba(var(--primary-color-rgb, 13, 110, 253), 0.2);
    }
    100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }
}

/* Section visibility animation */
.counters-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.counters-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Counter value animation */
.counter-value {
    display: inline-block;
    position: relative;
    font-weight: 700;
    transition: color 0.3s ease;
}

/* Counter completed animation */
.counter-completed {
    color: var(--primary-color, #0d6efd);
    animation: pulse 1s ease-in-out 0.2s;
}

/* Counter card animation */
.counter-card-animated {
    animation: glow 2s ease-in-out infinite;
}

/* Active counter card animation */
.counter-card-active {
    z-index: 2;
    position: relative;
}

.counter-card-active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #102e50; /* Primary color from admin dashboard */
    opacity: 0.5;
    animation: pulse-border 1.5s ease-out infinite;
}

@keyframes pulse-border {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.08);
        opacity: 0;
    }
    100% {
        transform: scale(1.08);
        opacity: 0;
    }
}

/* Circle progress animation */
.counter-card-active .counter-icon {
    animation: bounce 0.8s ease infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-5px);
    }
}

/* Hover effects - using admin dashboard colors */
.counter-card:nth-child(1):hover .counter-icon {
    background: linear-gradient(135deg, #102e50 0%, #0e2540 100%);
}

.counter-card:nth-child(2):hover .counter-icon {
    background: linear-gradient(135deg, #f5c45e 0%, #e5b64e 100%);
    color: #102e50; /* Dark text for light background */
}

.counter-card:nth-child(3):hover .counter-icon {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.counter-card:nth-child(4):hover .counter-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}
