/* CardCoin Billing System Styles */

/* Balance Display in Header */
.cardcoin-display {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
}

.cardcoin-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.cardcoin-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.cardcoin-icon {
    font-size: 16px;
    animation: coinSpin 3s ease-in-out infinite;
}

@keyframes coinSpin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

/* Modal Overlay */
.billing-modal-overlay {
    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: 10000;
    animation: fadeIn 0.3s ease;
}

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

/* Modal Window */
.billing-modal {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.billing-modal.large {
    max-width: 800px;
}

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

/* Modal Header */
.billing-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.billing-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
}

.billing-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.billing-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Modal Body */
.billing-modal-body {
    padding: 25px;
}

/* Modal Footer */
.billing-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    min-height: 70px;
    flex-wrap: wrap;
}

/* Balance Warning */
.balance-warning {
    text-align: center;
}

.balance-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

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

.balance-item.shortage {
    color: #dc3545;
    font-weight: 600;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
}

.balance-label {
    color: #666;
}

.balance-value {
    font-weight: 600;
    color: #333;
}

.warning-message {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 10px;
    padding: 15px;
    color: #721c24;
    font-weight: 500;
}

/* Top-up Form */
.topup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Quick Amounts */
.quick-amounts {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-amount-label {
    font-size: 14px;
    color: #666;
    margin-right: 5px;
}

.quick-amount {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-amount:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* Account Summary */
.account-summary {
    margin-bottom: 30px;
}

.balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    text-align: center;
}

.balance-card h4 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.balance-amount {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.balance-stats {
    display: flex;
    justify-content: space-around;
    opacity: 0.9;
    font-size: 14px;
}

/* Metrics Section */
.metrics-section {
    margin-bottom: 30px;
}

.metrics-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.metric-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.metric-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-bottom: 3px;
}

.metric-monthly {
    font-size: 11px;
    color: #999;
}

/* Recent Transactions */
.recent-transactions h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
}

.transactions-list {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: #f8f9fa;
}

.transaction-info {
    flex: 1;
}

.transaction-desc {
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}

.transaction-date {
    font-size: 12px;
    color: #999;
}

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

.transaction-amount.positive {
    color: #28a745;
}

.transaction-amount.negative {
    color: #dc3545;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    min-width: 120px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #d6d9dc;
}

/* Notifications */
.billing-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.billing-notification.success {
    background: #28a745;
}

.billing-notification.error {
    background: #dc3545;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .billing-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .billing-modal-body {
        padding: 20px;
    }
    
    .billing-modal-footer {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .balance-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .cardcoin-display {
        margin-right: 10px;
        padding: 6px 12px;
    }
    
    .cardcoin-info {
        font-size: 12px;
    }
    
    .quick-amounts {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .balance-amount {
        font-size: 2em;
    }
}