/* Basic styles for the counter plugin */
.wps-stats-counter-wrapper {
    margin: 20px 0;
    font-family: inherit; /* Use theme font */
}

/* Desktop styles (default, for screens 1025px and wider) */
.wps-counter-grid {
    /* Grid styles are inline for customization per instance */
}

.wps-counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    min-height: 120px; /* Ensures consistent height on desktop */
}

.wps-number-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Space between icon and number */
    position: relative;
    width: 100%;
}

.wps-number {
    transition: all 0.3s ease;
    line-height: 1.2;
    /* Inherit color from parent or allow theme override */
    color: inherit; 
}

.wps-label {
    margin-top: 10px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

.wps-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* Fix icon vertical alignment */
}

.wps-icon {
    /* Ensure icon inherits color from the wrapper/text */
    color: inherit; 
    display: inline-block;
}

/* Icon positioning - Flexbox logic */

/* Left: Icon - Number */
.wps-number-wrapper[data-icon-position="left"] {
    flex-direction: row;
}

/* Right: Number - Icon */
.wps-number-wrapper[data-icon-position="right"] {
    flex-direction: row-reverse;
}

/* Top: Icon over Number */
.wps-number-wrapper[data-icon-position="top"] {
    flex-direction: column;
    gap: 10px;
}

/* Bottom: Number over Icon */
.wps-number-wrapper[data-icon-position="bottom"] {
    flex-direction: column-reverse;
    gap: 10px;
}


/* Tablet styles (for screens 768px to 1024px) */
@media (max-width: 1024px) {
    .wps-stats-counter-wrapper {
        margin: 15px 0;
    }

    .wps-counter-item {
        padding: 12px;
        min-height: 100px;
    }

    .wps-number-wrapper {
        gap: 8px;
    }

    .wps-number {
        font-size: 90%; /* Reduce font size relative to desktop */
    }

    .wps-label {
        margin-top: 6px;
        font-size: 90%;
    }

    .wps-icon {
        font-size: 1em; /* Standard icon size for tablet */
    }

    /* Adjust icon positioning for tablet */
    .wps-number-wrapper[data-icon-position="top"],
    .wps-number-wrapper[data-icon-position="bottom"] {
        gap: 6px;
    }
}

/* Mobile styles (for screens 768px and below) */
@media (max-width: 768px) {
    .wps-stats-counter-wrapper {
        margin: 10px 0;
    }

    .wps-counter-item {
        padding: 10px;
        min-height: 80px; /* Compact for mobile */
        text-align: center;
    }

    .wps-number-wrapper {
        gap: 5px;
    }

    .wps-number {
        font-size: 80%; /* Further reduce for readability on small screens */
        line-height: 1.3;
    }

    .wps-label {
        margin-top: 5px;
        font-size: 85%;
        word-wrap: break-word; /* Prevent overflow on narrow screens */
    }

    .wps-icon {
        font-size: 0.9em; /* Smaller icons for mobile */
    }

    /* Mobile-specific icon adjustments: Stack vertically for top/bottom on small screens */
    .wps-number-wrapper[data-icon-position="top"],
    .wps-number-wrapper[data-icon-position="bottom"] {
        gap: 4px;
    }

    .wps-number-wrapper[data-icon-position="left"],
    .wps-number-wrapper[data-icon-position="right"] {
        flex-direction: row; /* Keep horizontal on mobile if space allows */
    }
}