/* ════════════════════════════════════════════════════════════════════════════
   File: /client/css/creditModule.css
   Created: 2026-01-16
   Last Edit: 2026-01-16
   Purpose: Styles for the universal credit module - purchase and tip modals,
            balance displays, and notification toasts.
   ════════════════════════════════════════════════════════════════════════════ */

/* --------------------------------
   Modal Overlay
   -------------------------------- */
.credit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

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

/* --------------------------------
   Modal Container
   -------------------------------- */
.credit-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

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

/* --------------------------------
   Modal Header
   -------------------------------- */
.credit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.credit-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
}

.credit-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.credit-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* --------------------------------
   Modal Body
   -------------------------------- */
.credit-modal-body {
    padding: 30px;
}

.credit-balance-info {
    text-align: center;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.credit-balance-info strong {
    color: #4CAF50;
    font-size: 18px;
}

/* --------------------------------
   Credit Packages Grid
   -------------------------------- */
.credit-packages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.credit-package {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.credit-package:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(76, 175, 80, 0.5);
    transform: translateY(-2px);
}

.credit-package.selected {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(56, 142, 60, 0.2));
    border-color: #4CAF50;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

.credit-package.popular {
    border-color: #FF9800;
}

.popular-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.credit-package-credits {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.credit-package-price {
    font-size: 28px;
    font-weight: 700;
    color: #4CAF50;
}

/* --------------------------------
   Custom Amount Input
   -------------------------------- */
.credit-custom-amount,
.tip-custom-amount {
    margin-bottom: 25px;
}

.credit-custom-amount label,
.tip-custom-amount label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
}

.credit-custom-amount input,
.tip-custom-amount input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    transition: all 0.3s;
}

.credit-custom-amount input:focus,
.tip-custom-amount input:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.08);
}

/* --------------------------------
   Purchase/Tip Button
   -------------------------------- */
.btn-purchase-credits,
.btn-send-tip {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.btn-purchase-credits:hover:not(:disabled),
.btn-send-tip:hover:not(:disabled) {
    background: linear-gradient(135deg, #66BB6A, #4CAF50);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.btn-purchase-credits:disabled,
.btn-send-tip:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
}

/* --------------------------------
   Tip Amounts Grid
   -------------------------------- */
.tip-amounts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.tip-amount-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tip-amount-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(233, 30, 99, 0.5);
    transform: scale(1.05);
}

.tip-amount-btn.selected {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(194, 24, 91, 0.2));
    border-color: #E91E63;
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

/* --------------------------------
   Tip Messages Grid
   -------------------------------- */
.tip-messages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.tip-message-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.3;
}

.tip-message-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.tip-message-btn.selected {
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.15), rgba(66, 165, 245, 0.15));
    border-color: #64B5F6;
    color: #fff;
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.2);
}

/* --------------------------------
   Info Text
   -------------------------------- */
.credit-info-text {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin: 0;
}

/* --------------------------------
   Balance Warning
   -------------------------------- */
.tip-balance-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    color: #FF9800;
    font-size: 14px;
    margin-top: 15px;
}

.buy-more-link {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
}

.buy-more-link:hover {
    text-decoration: underline;
}

/* --------------------------------
   Notification Toast
   -------------------------------- */
.credit-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 18px 25px;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease-out;
}

.credit-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.credit-notification-success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.credit-notification-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.credit-notification-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

/* --------------------------------
   Quick Tip Button (for player/artist pages)
   -------------------------------- */
.btn-quick-tip {
    background: linear-gradient(135deg, #E91E63, #C2185B);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-quick-tip:hover {
    background: linear-gradient(135deg, #F06292, #E91E63);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.4);
    transform: translateY(-2px);
}

.btn-quick-tip::before {
    content: '💝';
    font-size: 16px;
}

/* --------------------------------
   Responsive Design
   -------------------------------- */
@media (max-width: 500px) {
    .credit-packages-grid {
        grid-template-columns: 1fr;
    }
    
    .tip-amounts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .credit-modal {
        width: 95%;
        max-height: 95vh;
    }
}
