/* --- [Credit System Style] --- */

/* 1. Credit Balance Widget (Sidebar Header) */
.credit-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credit-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.credit-icon {
    font-size: 14px;
}

.credit-amount {
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
    /* Amber-400 for gold coin look */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.credit-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 2px;
}

/* 2. Charge Modal */
.credit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    /* JS to toggle */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.credit-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.credit-modal-content {
    background: white;
    width: 400px;
    max-width: 90%;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.credit-modal-overlay.show .credit-modal-content {
    transform: translateY(0);
}

.credit-modal-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.credit-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-balance-display {
    margin-top: 10px;
    font-size: 28px;
    font-weight: 800;
    color: #fbbf24;
}

.credit-packages-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.package-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.package-option:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.package-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.package-radio {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #3b82f6;
}

.package-info {
    flex: 1;
}

.package-amount {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: block;
}

.package-price {
    font-size: 13px;
    color: #64748b;
}

.package-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 99px;
}

.credit-modal-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: right;
}

.btn-charge {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-charge:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.btn-cancel {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    margin-right: 8px;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #f1f5f9;
}

/* 3. Deduct Confirmation Modal */
.deduct-modal-content {
    background: white;
    width: 320px;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.deduct-icon {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
}

.deduct-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.deduct-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

.btn-confirm-use {
    background: #1e293b;
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    cursor: pointer;
}

.btn-confirm-use:hover {
    background: #334155;
}

.free-usage-badge {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 12px;
}