/* Billing & Credits Page - Custom Styles */
/* Version: 2.1.0 - Updated 2026-01-12 */

/* ========================================
   Card Body Replacement - Mobile Fix
   ======================================== */

.cb-inner {
    flex: 1 1 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .cb-inner {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .cb-inner {
        padding: 0.75rem;
    }
}

/* ========================================
   Credit Balance Card
   ======================================== */

.credit-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none !important;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.credit-balance-card .ads-card-body {
    padding: 2rem;
    color: #fff;
}

.credit-balance-card .balance-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credit-balance-card .balance-amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin: 0.5rem 0;
}

.credit-balance-card .balance-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.credit-balance-card .balance-icon {
    font-size: 6rem;
    opacity: 0.15;
}

/* Mobile responsive balance card */
@media (max-width: 576px) {
    .credit-balance-card .ads-card-body {
        padding: 1.5rem;
    }
    
    .credit-balance-card .balance-amount {
        font-size: 2.5rem;
    }
    
    .credit-balance-card .balance-icon {
        font-size: 4rem;
    }
}

/* ========================================
   Stats Cards
   ======================================== */

.stat-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

.stat-card .stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

/* ========================================
   Transactions Table
   ======================================== */

.transactions-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.transactions-card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.transactions-card .card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
}

.transactions-table {
    margin: 0;
}

.transactions-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    padding: 1rem;
}

.transactions-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

.transactions-table tbody tr:hover {
    background: #f8f9fa;
}

/* Transaction type badges */
.transaction-type {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.transaction-type.credit {
    background: #d4edda;
    color: #155724;
}

.transaction-type.debit {
    background: #f8d7da;
    color: #721c24;
}

.transaction-type.pending {
    background: #fff3cd;
    color: #856404;
}

/* Transaction amount styling */
.transaction-amount {
    font-weight: 600;
    font-size: 1rem;
}

.transaction-amount.positive {
    color: #198754;
}

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

/* ========================================
   Quick Actions
   ======================================== */

.quick-actions-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    background: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #212529;
    height: 100%;
}

.quick-action-btn:hover {
    border-color: #0d6efd;
    background: #f8fbff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.15);
    color: #0d6efd;
}

.quick-action-btn .action-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.quick-action-btn .action-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

/* Action icon colors */
.quick-action-btn.buy-credits .action-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.quick-action-btn.create-ad .action-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.quick-action-btn.view-ads .action-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #6610f2 100%);
    color: #fff;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: #adb5bd;
}

.empty-state .empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.empty-state .empty-text {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* ========================================
   Pagination
   ======================================== */

.billing-pagination {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.billing-pagination .page-link {
    border-radius: 8px;
    margin: 0 0.125rem;
    border: none;
    color: #6c757d;
}

.billing-pagination .page-link:hover {
    background: #e9ecef;
    color: #212529;
}

.billing-pagination .page-item.active .page-link {
    background: #0d6efd;
    color: #fff;
}

/* ========================================
   Billing Info Card
   ======================================== */

.billing-info-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.billing-info-card .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.billing-info-card .info-row:last-child {
    border-bottom: none;
}

.billing-info-card .info-label {
    color: #6c757d;
    font-size: 0.875rem;
}

.billing-info-card .info-value {
    color: #212529;
    font-weight: 500;
}

/* ========================================
   Dark Mode Support
   ======================================== */

@media (prefers-color-scheme: dark) {
    .stat-card,
    .transactions-card,
    .quick-actions-card,
    .billing-info-card {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .stat-card .stat-value,
    .transactions-card .card-title,
    .empty-state .empty-title,
    .billing-info-card .info-value {
        color: #f8f9fa;
    }
    
    .stat-card .stat-label,
    .transactions-table thead th,
    .empty-state .empty-text,
    .billing-info-card .info-label {
        color: #a0aec0;
    }
    
    .transactions-card .card-header {
        background: #374151;
        border-color: #4a5568;
    }
    
    .transactions-table tbody td {
        border-color: #4a5568;
    }
    
    .transactions-table tbody tr:hover {
        background: #374151;
    }
    
    .quick-action-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #f8f9fa;
    }
    
    .quick-action-btn:hover {
        background: #374151;
        color: #60a5fa;
    }
    
    .empty-state .empty-icon {
        background: #374151;
        color: #6b7280;
    }
    
    .billing-pagination .page-link {
        background: #2d3748;
        color: #9ca3af;
    }
    
    .billing-pagination .page-link:hover {
        background: #374151;
        color: #f8f9fa;
    }
}

/* ========================================
   Desktop Visibility Fixes
   ======================================== */

/* Ensure content is visible on all screen sizes */
.credit-balance-card,
.stat-card,
.transactions-card,
.quick-actions-card,
.billing-info-card {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Desktop specific fixes */
@media (min-width: 992px) {
    .credit-balance-card,
    .stat-card,
    .transactions-card {
        display: block !important;
    }
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .transactions-table {
        font-size: 0.875rem;
    }
    
    .transactions-table thead th,
    .transactions-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .quick-action-btn {
        padding: 1rem;
    }
    
    .quick-action-btn .action-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .transactions-card .card-header {
        padding: 1rem;
    }
}
