/* ── Gate UI: Usage Badge ──────────────────────────────────────────── */

.eq-gate-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 0 10px 0;
    min-height: 28px;
}

.eq-gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    user-select: none;
}

.eq-gate-badge--free {
    background: #f0f4ff;
    color: #4a6cf7;
    border: 1px solid #d6e0ff;
}

.eq-gate-badge--last {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    animation: eq-gate-pulse 2s ease-in-out infinite;
}

.eq-gate-badge--over {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.eq-gate-badge--pro {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    border: 1px solid transparent;
}

.eq-gate-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

[dir="rtl"] .eq-gate-status {
    justify-content: flex-start;
}

@keyframes eq-gate-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Gate UI: Progressive Message Banner ──────────────────────────── */

.eq-gate-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-8px);
}

.eq-gate-banner.eq-gate-visible {
    opacity: 1;
    transform: translateY(0);
}

.eq-gate-banner--info {
    background: #f0f4ff;
    color: #3b4c8a;
    border: 1px solid #d6e0ff;
}

.eq-gate-banner--warn {
    background: #fff7ed;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.eq-gate-banner--last {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fcd34d;
}

.eq-gate-banner svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.eq-gate-banner-dismiss {
    margin-inline-start: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.2s;
    line-height: 1;
}

.eq-gate-banner-dismiss:hover {
    opacity: 1;
}

/* ── Gate UI: Soft Paywall Overlay ─────────────────────────────────── */

.eq-gate-paywall-wrap {
    position: relative;
    overflow: hidden;
}

.eq-gate-paywall-wrap > :not(.eq-gate-paywall) {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.eq-gate-paywall {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
}

[data-theme="dark"] .eq-gate-paywall {
    background: rgba(15, 23, 42, 0.8);
}

.eq-gate-paywall-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.eq-gate-paywall-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.eq-gate-paywall-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

[data-theme="dark"] .eq-gate-paywall-title {
    color: #f1f5f9;
}

.eq-gate-paywall-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px 0;
    max-width: 400px;
    line-height: 1.6;
}

[data-theme="dark"] .eq-gate-paywall-desc {
    color: #94a3b8;
}

.eq-gate-paywall-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.eq-gate-paywall-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.eq-gate-paywall-btn svg {
    width: 18px;
    height: 18px;
}

.eq-gate-paywall-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 16px;
}

/* ── Gate UI: Pre-run Paywall (blocks before processing) ──────────── */

.eq-gate-preblock {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    margin: 16px 0;
    background: #fafbff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.eq-gate-preblock.eq-gate-visible {
    display: flex;
}

.eq-gate-preblock .eq-gate-paywall-icon,
.eq-gate-preblock .eq-gate-paywall-title,
.eq-gate-preblock .eq-gate-paywall-desc,
.eq-gate-preblock .eq-gate-paywall-btn,
.eq-gate-preblock .eq-gate-paywall-hint {
    /* Reuse paywall styles */
}

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

@media (max-width: 640px) {
    .eq-gate-paywall {
        padding: 24px 16px;
    }

    .eq-gate-paywall-title {
        font-size: 17px;
    }

    .eq-gate-paywall-desc {
        font-size: 13px;
    }

    .eq-gate-paywall-btn {
        padding: 10px 24px;
        font-size: 14px;
    }

    .eq-gate-paywall-icon {
        width: 44px;
        height: 44px;
    }

    .eq-gate-paywall-icon svg {
        width: 22px;
        height: 22px;
    }
}
