/* ===== PURCHASE CREDIT MODAL STYLES ===== */

.purchase-credit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.purchase-credit-content {
    background: var(--card-bg);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-large);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-gray);
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.purchase-credit-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-gray);
    background: var(--light-gray);
}

.purchase-credit-modal .modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-small);
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: var(--medium-gray);
}

/* Modal Body */
.purchase-credit-modal .modal-body {
    padding: 2rem;
}

/* User Info Section */
.user-info-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: var(--radius-medium);
}

.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
}

.user-details h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.credit-balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.credit-icon {
    font-size: 1.2rem;
}

.credit-amount {
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
}

/* Credit Requirement Section */
.credit-requirement-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: var(--radius-medium);
    border-left: 4px solid var(--warning-color);
}

.requirement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: var(--font-size-base);
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.requirement-label {
    color: var(--text-secondary);
}

.requirement-value {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.requirement-item.total-requirement {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-gray);
    font-weight: var(--font-weight-semibold);
}

.requirement-item.deficit .requirement-value {
    color: var(--primary-color);
    font-size: var(--font-size-lg);
}

/* Credit Purchase Section */
.credit-purchase-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.pricing-info {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    text-align: center;
    background: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-medium);
}

.credit-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.credit-package {
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-medium);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.credit-package:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.credit-package.selected {
    border-color: var(--success-color);
    background: rgba(var(--primary-color-rgb), 0.1);
}

.package-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-small);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.package-credits {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.package-price {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.package-bonus {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* Custom Amount Section */
.custom-amount-section {
    border-top: 1px solid var(--border-gray);
    padding-top: 1.5rem;
}

.custom-amount-section h5 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.custom-amount-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.custom-amount-input input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-medium);
    font-size: var(--font-size-base);
    background: var(--card-bg);
    color: var(--text-primary);
}

.custom-amount-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.currency-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

#customPrice {
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
}

/* Modal Actions */
.purchase-credit-modal .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-gray);
    background: var(--light-gray);
}

.purchase-credit-modal .modal-actions .btn {
    min-width: 120px;
}

#purchaseCreditsBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .purchase-credit-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .purchase-credit-modal .modal-header,
    .purchase-credit-modal .modal-body,
    .purchase-credit-modal .modal-actions {
        padding: 1rem;
    }
    
    .user-info-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .credit-packages {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .credit-package {
        padding: 0.75rem;
    }
    
    .package-credits {
        font-size: var(--font-size-base);
    }
    
    .custom-amount-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .purchase-credit-modal .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .credit-packages {
        grid-template-columns: 1fr 1fr;
    }
    
    .requirement-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .purchase-credit-content {
    background: var(--card-bg);
    border-color: var(--border-gray);
}

[data-theme="dark"] .purchase-credit-modal .modal-header {
    background: var(--medium-gray);
    border-bottom-color: var(--border-gray);
}

[data-theme="dark"] .user-info-section,
[data-theme="dark"] .credit-requirement-section {
    background: var(--medium-gray);
}

[data-theme="dark"] .credit-package {
    background: var(--medium-gray);
    border-color: var(--border-gray);
}

[data-theme="dark"] .custom-amount-input input {
    background: var(--medium-gray);
    border-color: var(--border-gray);
    color: var(--text-primary);
}

[data-theme="dark"] .purchase-credit-modal .modal-actions {
    background: var(--medium-gray);
    border-top-color: var(--border-gray);
} 