/* ==========================================================================
   Credit Display Widget (existing header widget – kept mostly as-is)
   ========================================================================== */

   .credit-display-wrapper {
    display: inline-flex;
}

.credit-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.15);
    overflow: hidden;
}

.credit-icon {
    display: flex;
    color: #6366f1;
}

.credit-icon svg {
    width: 20px;
    height: 20px;
}

.credit-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.credit-label {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
}

.credit-amount-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.credit-amount {
    font-weight: 700;
    font-size: 14px;
}

.credit-currency {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
}

/* دکمه‌ی افزایش – حالا trigger مدال است، نه لینک */
.credit-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.credit-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.credit-add-btn svg {
    width: 14px;
    height: 14px;
}

.credit-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: credit-shine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes credit-shine {
    0%, 40% { transform: translateX(-100%); }
    60% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================================================
   Credit Purchase Modal – Package Cards
   ========================================================================== */

.credit-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.credit-package-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    border-radius: 18px;
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.credit-package-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}

.credit-package-card.is-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 10px 24px rgba(99, 102, 241, 0.12);
}

.credit-package-card.is-popular {
    border-color: rgba(168, 85, 247, 0.35);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.04), rgba(255, 255, 255, 1) 40%);
}

.credit-package-badge {
    position: absolute;
    top: -12px;
    inset-inline-end: 16px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.credit-package-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.credit-package-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.credit-package-credits {
    font-size: 12px;
    color: #6b7280;
}

.credit-package-credits span {
    color: #9ca3af;
}

.credit-package-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 16px;
}

.credit-package-price .amount {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.credit-package-price .unit {
    font-size: 12px;
    color: #9ca3af;
}

.credit-package-equivalents {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px dashed rgba(99, 102, 241, 0.25);
}

.credit-equivalents-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 8px;
}

.credit-equivalents-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.credit-equivalent-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 11.5px;
    font-weight: 600;
    color: #4338ca;
    white-space: nowrap;
}

.credit-equivalent-chip svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: #a855f7;
}

.credit-package-features {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.credit-package-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.credit-package-features li svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #22c55e;
}

.credit-package-select-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1.5px solid rgba(99, 102, 241, 0.35);
    background: transparent;
    color: #6366f1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.credit-package-select-btn:hover {
    background: rgba(99, 102, 241, 0.08);
}

.credit-package-select-btn.is-active {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-color: transparent;
    color: #fff;
}

/* ==========================================================================
   Payment Summary
   ========================================================================== */

.credit-payment-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.03);
}

.credit-payment-method {
    display: flex;
    align-items: center;
    gap: 10px;
}

.credit-payment-method-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff;
    color: #6366f1;
}

.credit-payment-method-icon svg {
    width: 18px;
    height: 18px;
}

.credit-payment-method-label {
    display: block;
    font-size: 11px;
    color: #9ca3af;
}

.credit-payment-method-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.credit-payment-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.credit-payment-total .label {
    font-size: 11px;
    color: #9ca3af;
}

.credit-payment-total .value {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.credit-payment-total .value .unit {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
}

.credit-purchase-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    font-size: 13px;
}

/* ==========================================================================
   Dark Mode  (فعال می‌شه وقتی body کلاس theme-dark بگیره)
   ========================================================================== */

.theme-dark .credit-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(168, 85, 247, 0.14));
    border-color: rgba(129, 140, 248, 0.25);
}

.theme-dark .credit-icon {
    color: #a5b4fc;
}

.theme-dark .credit-label,
.theme-dark .credit-currency {
    color: rgba(255, 255, 255, 0.55);
}

.theme-dark .credit-amount {
    color: #f9fafb;
}

.theme-dark .credit-add-btn {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    /* color: #0b0b12; */
}

.theme-dark .credit-add-btn:hover {
    box-shadow: 0 6px 18px rgba(129, 140, 248, 0.4);
}

.theme-dark .credit-package-card {
    background: #16161f;
    border-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .credit-package-card:hover {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.theme-dark .credit-package-card.is-selected {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2), 0 10px 24px rgba(0, 0, 0, 0.4);
}

.theme-dark .credit-package-card.is-popular {
    border-color: rgba(192, 132, 252, 0.35);
    background: linear-gradient(180deg, rgba(192, 132, 252, 0.08), #16161f 45%);
}

.theme-dark .credit-package-badge {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    /* color: #0b0b12; */
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.35);
}

.theme-dark .credit-package-title {
    color: #f9fafb;
}

.theme-dark .credit-package-credits,
.theme-dark .credit-package-credits span,
.theme-dark .credit-package-price .unit {
    color: #9ca3af;
}

.theme-dark .credit-package-price .amount {
    color: #f9fafb;
}

.theme-dark .credit-package-features li {
    color: #d1d5db;
}

.theme-dark .credit-package-features li svg {
    color: #4ade80;
}

.theme-dark .credit-package-select-btn {
    border-color: rgba(129, 140, 248, 0.4);
    color: #a5b4fc;
}

.theme-dark .credit-package-select-btn:hover {
    background: rgba(129, 140, 248, 0.12);
}

.theme-dark .credit-package-select-btn.is-active {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    color: #fff;
}

.theme-dark .credit-payment-summary {
    background: rgba(255, 255, 255, 0.04);
}

.theme-dark .credit-payment-method-icon {
    background: #16161f;
    color: #a5b4fc;
}

.theme-dark .credit-payment-method-label,
.theme-dark .credit-payment-total .label,
.theme-dark .credit-payment-total .value .unit {
    color: #9ca3af;
}

.theme-dark .credit-payment-method-value,
.theme-dark .credit-payment-total .value {
    color: #f9fafb;
}

.theme-dark .credit-purchase-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.theme-dark .credit-package-equivalents {
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.3);
}

.theme-dark .credit-equivalents-label {
    color: #a5b4fc;
}

.theme-dark .credit-equivalent-chip {
    background: #16161f;
    border-color: rgba(129, 140, 248, 0.3);
    color: #c4b5fd;
}

.theme-dark .credit-equivalent-chip svg {
    color: #c084fc;
}