/**
 * Product Sales & Views Live Stats — Frontend Styles
 *
 * @author    mypresta.rocks <info@mypresta.rocks>
 * @copyright Copyright (c) mypresta.rocks
 */

/* ─── Widget Container ────────────────────────────────────────────── */

.mprpsvls-widget {
    margin: 14px 0;
    padding: 0;
}

/* ─── Horizontal Bar ──────────────────────────────────────────────── */

.mprpsvls-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
}

/* ─── Each Stat (inline row) ──────────────────────────────────────── */

.mprpsvls-stat {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 0.835rem;
    color: #475569;
    line-height: 1;
    white-space: nowrap;
}

.mprpsvls-stat + .mprpsvls-stat {
    border-left: 1px solid #e2e8f0;
}

/* ─── Icon ────────────────────────────────────────────────────────── */

.mprpsvls-icon {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.mprpsvls-icon svg {
    display: block;
}

/* ─── Number ──────────────────────────────────────────────────────── */

.mprpsvls-number {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.9rem;
}

/* ─── Label ───────────────────────────────────────────────────────── */

.mprpsvls-label {
    color: #64748b;
    font-weight: 400;
}

/* ─── Clickable Sales Stat ────────────────────────────────────────── */

.mprpsvls-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mprpsvls-clickable:hover {
    background-color: #eef2ff;
}

.mprpsvls-clickable:active {
    background-color: #e0e7ff;
}

.mprpsvls-clickable .mprpsvls-label {
    color: #4f46e5;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.mprpsvls-clickable .mprpsvls-icon {
    color: #6366f1;
}

.mprpsvls-clickable .mprpsvls-number {
    color: #4f46e5;
}

.mprpsvls-arrow {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4f46e5;
    line-height: 1;
    margin-left: -2px;
}

/* ─── Live Viewers ────────────────────────────────────────────────── */

.mprpsvls-live .mprpsvls-number {
    color: #dc2626;
}

.mprpsvls-live .mprpsvls-label {
    color: #dc2626;
}

.mprpsvls-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ef4444;
    flex-shrink: 0;
    animation: mprpsvls-pulse 1.5s ease-in-out infinite;
}

@keyframes mprpsvls-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.3);
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
    }
}

/* ─── Modal Overlay ───────────────────────────────────────────────── */

.mprpsvls-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mprpsvls-modal-overlay.mprpsvls-visible {
    opacity: 1;
}

.mprpsvls-modal {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 440px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.mprpsvls-modal-overlay.mprpsvls-visible .mprpsvls-modal {
    transform: translateY(0);
}

.mprpsvls-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.mprpsvls-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.mprpsvls-modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: #94a3b8;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}

.mprpsvls-modal-close:hover {
    color: #1e293b;
}

.mprpsvls-modal-body {
    padding: 12px 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.mprpsvls-modal-loading {
    text-align: center;
    padding: 20px 0;
    color: #94a3b8;
}

/* ─── Orders List in Modal ────────────────────────────────────────── */

.mprpsvls-orders-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mprpsvls-orders-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.mprpsvls-orders-list li:last-child {
    border-bottom: none;
}

.mprpsvls-order-buyer {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.mprpsvls-order-location {
    color: #64748b;
    font-size: 0.8rem;
}

.mprpsvls-order-info {
    flex: 1;
    min-width: 0;
}

.mprpsvls-order-time {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.mprpsvls-order-empty {
    text-align: center;
    padding: 20px 0;
    color: #94a3b8;
}

/* ─── Listing Badge ───────────────────────────────────────────────── */

.mprpsvls-listing-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 3px;
    padding: 2px 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.mprpsvls-badge-count {
    font-weight: 700;
    color: #2c6fbb;
}

.mprpsvls-badge-label {
    color: #5a8fc4;
}

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 576px) {
    .mprpsvls-bar {
        flex-direction: column;
        width: 100%;
    }

    .mprpsvls-stat {
        width: 100%;
        box-sizing: border-box;
    }

    .mprpsvls-stat + .mprpsvls-stat {
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }

    .mprpsvls-modal {
        width: 95%;
        max-height: 85vh;
    }
}
