/* ============================================
   Counter Widget Styles - v2.0
   Optimized animations & visual effects
   ============================================ */

/* ---- Container ---- */
.svs-counter-container {
    display: grid;
}

.svs-cols-1 { grid-template-columns: repeat(1, 1fr); }
.svs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.svs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.svs-cols-4 { grid-template-columns: repeat(4, 1fr); }
.svs-cols-5 { grid-template-columns: repeat(5, 1fr); }
.svs-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* ---- Card Base ---- */
.svs-counter-card {
    position: relative;
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
    transition:
        transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

/* ---- Decorative corner glow ---- */
.svs-counter-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.06) 0%, transparent 70%);
    transition: opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

.svs-counter-card:hover::after {
    opacity: 1;
}

/* ============================================
   Card Entrance Animation (spring bounce)
   ============================================ */

@keyframes counterBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(40px);
    }
    40% {
        opacity: 1;
        transform: scale(1.04) translateY(-4px);
    }
    70% {
        transform: scale(0.98) translateY(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.svs-counter-card.animated {
    animation: counterBounceIn 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Staggered delays */
.svs-counter-card:nth-child(1) { animation-delay: 0ms; }
.svs-counter-card:nth-child(2) { animation-delay: 120ms; }
.svs-counter-card:nth-child(3) { animation-delay: 240ms; }
.svs-counter-card:nth-child(4) { animation-delay: 360ms; }
.svs-counter-card:nth-child(5) { animation-delay: 480ms; }
.svs-counter-card:nth-child(6) { animation-delay: 600ms; }
.svs-counter-card:nth-child(7) { animation-delay: 720ms; }
.svs-counter-card:nth-child(8) { animation-delay: 840ms; }

/* ============================================
   Icon — with animated pulse ring
   ============================================ */

.svs-counter-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #4CAF50;
    margin-bottom: 20px;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.svs-counter-icon::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.08);
    transform: scale(0.9);
    transition: transform 0.4s ease, background 0.4s ease;
    z-index: -1;
}

@keyframes iconPulseRing {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50%      { transform: scale(1.15); opacity: 0; }
}

.svs-counter-icon::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid rgba(76, 175, 80, 0.25);
    animation: iconPulseRing 3s ease-in-out infinite;
    z-index: -2;
}

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

.svs-counter-card:hover .svs-counter-icon::before {
    transform: scale(1.1);
    background: rgba(76, 175, 80, 0.15);
}

/* ============================================
   Number Wrapper
   ============================================ */

.svs-counter-number-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.svs-counter-prefix,
.svs-counter-suffix {
    font-size: 24px;
    font-weight: 600;
    color: #666;
}

.svs-counter-number {
    font-size: 48px;
    font-weight: 800;
    color: #333;
    line-height: 1;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* ---- Number glow on count completion ---- */
@keyframes numberGlowPulse {
    0%, 100% {
        text-shadow:
            0 0 8px rgba(76, 175, 80, 0.3),
            0 0 20px rgba(76, 175, 80, 0.1);
    }
    50% {
        text-shadow:
            0 0 16px rgba(76, 175, 80, 0.5),
            0 0 35px rgba(76, 175, 80, 0.2);
    }
}

.svs-counter-card.svs-counter-done .svs-counter-number {
    animation: numberGlowPulse 2s ease-in-out 1 forwards;
    animation-delay: 0.1s;
}

/* ============================================
   Title & Description
   ============================================ */

.svs-counter-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    transition: color 0.3s ease;
}

.svs-counter-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
    transition: color 0.3s ease;
}

/* ============================================
   Hover Effects
   ============================================ */

/* Lift */
.svs-counter-card.hover-lift:hover {
    transform: translateY(-12px);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.13),
        0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Scale */
.svs-counter-card.hover-scale:hover {
    transform: scale(1.05);
    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.1),
        0 3px 8px rgba(0, 0, 0, 0.05);
}

/* Glow */
.svs-counter-card.hover-glow:hover {
    box-shadow:
        0 0 25px rgba(76, 175, 80, 0.35),
        0 0 50px rgba(76, 175, 80, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ============================================
   Card Shape Variants
   ============================================ */

/* Square */
.svs-counter-shape-square {
    border-radius: 0 !important;
}

/* Rounded (default) */
.svs-counter-shape-rounded {
    border-radius: 10px;
}

/* Circle */
.svs-counter-shape-circle {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px !important;
}

/* Hexagon */
.svs-counter-shape-hexagon {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    padding: 50px 30px !important;
}

/* Diamond */
.svs-counter-shape-diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    padding: 55px 25px !important;
}

/* Pentagon */
.svs-counter-shape-pentagon {
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    padding: 45px 25px !important;
}

/*
   Clip-path shapes: use filter:drop-shadow() instead of box-shadow
   because box-shadow follows the bounding rect, not the clipped polygon.
*/
.svs-counter-card.svs-counter-shape-hexagon,
.svs-counter-card.svs-counter-shape-diamond,
.svs-counter-card.svs-counter-shape-pentagon {
    box-shadow: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

/* ---- Hover: lift ---- */
.svs-counter-card.svs-counter-shape-hexagon.hover-lift:hover,
.svs-counter-card.svs-counter-shape-diamond.hover-lift:hover,
.svs-counter-card.svs-counter-shape-pentagon.hover-lift:hover {
    filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.14));
}

/* ---- Hover: scale ---- */
.svs-counter-card.svs-counter-shape-hexagon.hover-scale:hover,
.svs-counter-card.svs-counter-shape-diamond.hover-scale:hover,
.svs-counter-card.svs-counter-shape-pentagon.hover-scale:hover {
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.1));
}

/* ---- Hover: glow ---- */
.svs-counter-card.svs-counter-shape-hexagon.hover-glow:hover,
.svs-counter-card.svs-counter-shape-diamond.hover-glow:hover,
.svs-counter-card.svs-counter-shape-pentagon.hover-glow:hover {
    filter: drop-shadow(0 0 22px rgba(76, 175, 80, 0.4));
}

/* ---- Circle glow override ---- */
.svs-counter-card.svs-counter-shape-circle.hover-glow:hover {
    box-shadow:
        0 0 30px rgba(76, 175, 80, 0.4),
        0 0 60px rgba(76, 175, 80, 0.1);
}

/* ---- Animated shapes: suppress pseudo-element decorations ---- */
.svs-counter-shape-hexagon::after,
.svs-counter-shape-diamond::after,
.svs-counter-shape-pentagon::after {
    display: none;
}

/* ---- Animated shapes: soften icon ring ---- */
.svs-counter-shape-hexagon .svs-counter-icon::before,
.svs-counter-shape-hexagon .svs-counter-icon::after,
.svs-counter-shape-diamond .svs-counter-icon::before,
.svs-counter-shape-diamond .svs-counter-icon::after,
.svs-counter-shape-pentagon .svs-counter-icon::before,
.svs-counter-shape-pentagon .svs-counter-icon::after {
    display: none;
}

/* ============================================
   Tablet (≤1024px)
   ============================================ */

@media (max-width: 1024px) {
    .svs-cols-tablet-1 { grid-template-columns: repeat(1, 1fr) !important; }
    .svs-cols-tablet-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .svs-cols-tablet-3 { grid-template-columns: repeat(3, 1fr) !important; }
    .svs-cols-tablet-4 { grid-template-columns: repeat(4, 1fr) !important; }
    .svs-cols-tablet-5 { grid-template-columns: repeat(5, 1fr) !important; }
    .svs-cols-tablet-6 { grid-template-columns: repeat(6, 1fr) !important; }
}

/* ============================================
   Mobile (≤768px)
   ============================================ */

@media (max-width: 768px) {
    .svs-cols-mobile-1 { grid-template-columns: repeat(1, 1fr) !important; }
    .svs-cols-mobile-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .svs-cols-mobile-3 { grid-template-columns: repeat(3, 1fr) !important; }

    .svs-counter-card {
        padding: 30px 20px;
    }

    .svs-cols-5 .svs-counter-card,
    .svs-cols-6 .svs-counter-card {
        padding: 20px 15px;
    }

    .svs-cols-5 .svs-counter-icon,
    .svs-cols-6 .svs-counter-icon {
        font-size: 35px;
        margin-bottom: 10px;
    }

    .svs-cols-5 .svs-counter-number,
    .svs-cols-6 .svs-counter-number {
        font-size: 28px;
    }

    .svs-cols-5 .svs-counter-title,
    .svs-cols-6 .svs-counter-title {
        font-size: 14px;
    }

    .svs-counter-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }

    .svs-counter-number {
        font-size: 36px;
    }

    .svs-counter-prefix,
    .svs-counter-suffix {
        font-size: 20px;
    }

    .svs-counter-title {
        font-size: 18px;
    }

    .svs-counter-description {
        font-size: 13px;
    }

    /* Shape fallbacks for mobile */
    .svs-counter-shape-circle {
        aspect-ratio: auto;
        border-radius: 20px;
        padding: 25px 20px !important;
    }

    .svs-counter-shape-hexagon,
    .svs-counter-shape-diamond,
    .svs-counter-shape-pentagon {
        clip-path: none;
        filter: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        padding: 30px 20px !important;
        border-radius: 10px;
    }
}

/* ============================================
   Elementor Editor — always visible
   ============================================ */

.elementor-editor-active .svs-counter-card {
    animation: none;
}
