/* ===============================
   Theme Variables (Minimal UI)
================================ */
:root {
    --primary: #0d6efd;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #facc15;
    --gray-100: #f8f9fa;
    --gray-200: #e5e7eb;
    --gray-600: #6b7280;
    --radius: 12px;
}

/* ===============================
   Buttons
================================ */
.wupp-btn,
.v2-btn,
.renew-btn {
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
}

.wupp-btn:hover,
.v2-btn:hover,
.renew-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.renew-btn {
    background: var(--success);
}

/* ===============================
   Copy Button
================================ */
.copy-btn {
    width: 100%;
    padding: 12px 14px;
    margin-top: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: background .2s;
}

.copy-btn:hover {
    background: var(--gray-100);
}

.copy-btn .icon-copy::before {
    content: "ðŸ“‹";
    font-size: 17px;
    opacity: .7;
}

/* ===============================
   Orders List (Card Style)
================================ */
.wupp-row {
    background: #fff;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.wupp-row-expired {
    opacity: .5;
}

.wupp-title {
    font-weight: 600;
    font-size: 15px;
}

.wupp-date {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* ===============================
   Status Indicator
================================ */
.wupp-indicator {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
}

.wupp-indicator.green { background: var(--success); }
.wupp-indicator.yellow { background: var(--warning); }
.wupp-indicator.red { background: var(--danger); }

.blink::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: .5;
    animation: wupp-pulse 1.4s infinite;
}

@keyframes wupp-pulse {
    0% { transform: scale(.7); opacity: .6; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ===============================
   Popup Overlay
================================ */
#wupp-popup-overlay,
.v2ray-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);

    display: none;              /* پیش‌فرض مخفی */
    align-items: center;
    justify-content: center;

    z-index: 99999;
}

/* فعال شدن overlay */
#wupp-popup-overlay.is-active,
.v2ray-popup.is-active {
    display: flex;
}


/* ===============================
   Popup Box
================================ */
#wupp-popup-box,
.v2ray-popup-inner,
.v2ray-popup-box {
    background: #fff;
    width: 92%;
    max-width: 520px;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    position: relative;
    text-align: center;
    animation: popupScale .25s ease;
}

@keyframes popupScale {
    from {
        transform: scale(.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===============================
   Popup Close
================================ */
#wupp-popup-close,
.v2ray-close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 22px;
    cursor: pointer;
    opacity: .5;
}

#wupp-popup-close:hover,
.v2ray-close:hover {
    opacity: 1;
}

/* ===============================
   Popup Buttons
================================ */
.v2ray-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.v2ray-buttons button,
.v2ray-buttons a,
.v2ray-popup-box button,
.v2ray-popup-box a {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    border: none;
    text-decoration: none;
    cursor: pointer;
}



/* ===============================
   Loading Box
================================ */
.loading-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    padding: 15px 0;
}


/* ===============================
   Spinner
================================ */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--primary, #007bff);
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ===============================
   V2Ray Rows (PRO)
================================ */

.v2ray-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v2ray-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.v2ray-row.sub {
    cursor: default;
}

.v2ray-row.all {
    background: #28a745;
    color: #fff;
    cursor: pointer;
}

.v2ray-flag {
    font-size: 22px;
}

.v2ray-flag img {
    width: 26px;
    height: 18px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.v2ray-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.v2ray-actions {
    display: flex;
    gap: 12px;
}

.copy-btn svg, .v2ray-actions svg {
    width: 20px;
    height: 20px;
    cursor: pointer;
    fill: currentColor;
    opacity: .85;
}

.v2ray-actions svg:hover {
    opacity: 1;
}

.v2ray-row.netmeli {
    background: #f3e8ff;
    border: 1px solid #a855f7;
}

.v2ray-row.netmeli .v2ray-title {
    color: #6b21a8;
    font-weight: 600;
}

/* QR popup image */
.v2ray-popup-inner img {
    max-width: 100%;
    border-radius: 12px;
}

/* ===============================
   QR Popup Alignment Fix
================================ */

.v2ray-popup-inner {
    text-align: center;
}

#wupp-qr {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px auto 0;
}