/**
 * Modern Dashboard Theme
 * Stripe-inspired design for payment platform
 * Safe to apply - enhances existing Bootstrap 5 without breaking functionality
 */

/* ===== MODERN COLOR SCHEME ===== */
:root {
    /* Primary Colors - Stripe-inspired purple */
    --primary: #00C853;
    --primary-hover: #00B248;
    --primary-light: #E8F5E9;
    
    /* Backgrounds */
    --bg-main: #FAFBFC;
    --bg-surface: #FFFFFF;
    --bg-hover: #F7FAFC;
    
    /* Text Colors */
    --text-primary: #1A202C;
    --text-secondary: #718096;
    --text-muted: #A0AEC0;
    
    /* Borders */
    --border-color: #E2E8F0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Status Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

/* ===== GLOBAL STYLES ===== */
body {
    background-color: var(--bg-main) !important;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

/* ===== MODERN CARDS ===== */
.card {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-sm) !important;
    background-color: var(--bg-surface);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
}

.card-header {
    background-color: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--bg-hover);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ===== MODERN BUTTONS ===== */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 1px 2px 0 rgba(99, 91, 255, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(99, 91, 255, 0.3);
}

.btn-success {
    background-color: var(--success) !important;
    color: white !important;
}

.btn-danger {
    background-color: var(--danger) !important;
    color: white !important;
}

.btn-warning {
    background-color: var(--warning) !important;
    color: white !important;
}

.btn-info {
    background-color: var(--info) !important;
    color: white !important;
}

.btn-outline-primary {
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    color: white !important;
}

/* ===== MODERN FORMS ===== */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 15px;
    transition: var(--transition);
    background-color: var(--bg-surface);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 14px;
}

/* ===== MODERN TABLES ===== */
.table {
    background-color: var(--bg-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background-color: var(--bg-hover);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* ===== MODERN BADGES ===== */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
}

.badge.bg-success {
    background-color: var(--success) !important;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: #78350F !important;
}

.badge.bg-info {
    background-color: var(--info) !important;
}

/* ===== MODERN ALERTS ===== */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: var(--success-light);
    color: #065F46;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991B1B;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #78350F;
}

.alert-info {
    background-color: var(--info-light);
    color: #1E40AF;
}

/* ===== METRIC CARDS (Dashboard Stats) ===== */
.metric-card {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-hover) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 14px;
    font-weight: 500;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--danger);
}

/* ===== CUSTOM SCROLLBAR ===== */
/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-hover);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #667eea var(--bg-hover);
}

/* ===== MODERN NAVIGATION ===== */
.navbar {
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

/* Don't override dark navbar background */
.navbar.navbar-dark {
    background-color: #212529 !important;
}

/* Light navbar gets modern background */
.navbar.navbar-light {
    background-color: var(--bg-surface) !important;
}

.navbar-brand {
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Ensure navbar brand is visible on dark backgrounds */
.navbar-dark .navbar-brand {
    color: #ffffff !important;
}

.navbar-light .navbar-brand {
    color: var(--text-primary) !important;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}

/* Ensure nav links are visible on dark navbar */
.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== MODERN SIDEBAR (if you have one) ===== */
.sidebar {
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* ===== PAYMENT METHOD OPTIONS ===== */
.payment-method-option {
    border: 2px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    padding: 1.25rem !important;
    margin-bottom: 1rem !important;
    cursor: pointer;
    transition: var(--transition) !important;
    background-color: var(--bg-surface);
}

.payment-method-option:hover {
    border-color: var(--primary) !important;
    background-color: var(--primary-light) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.payment-method-option.selected {
    border-color: var(--primary) !important;
    background-color: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

/* ===== AMOUNT BUTTONS ===== */
.btn-amount {
    border: 2px solid var(--border-color) !important;
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    transition: var(--transition) !important;
    margin-bottom: 0.75rem !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: var(--border-radius-sm) !important;
    font-weight: 500;
}

.btn-amount:hover {
    background-color: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    transform: translateY(-2px);
}

.btn-amount.active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(99, 91, 255, 0.3);
}

/* ===== MODERN DROPDOWNS ===== */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.625rem 1rem;
    transition: var(--transition);
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
}

/* ===== MODERN MODALS ===== */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* ===== MODERN PAGINATION ===== */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 0.5rem 0.875rem;
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}

.page-link:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(99, 91, 255, 0.25);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    z-index: 1;
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    background-color: var(--bg-hover);
    border-color: var(--border-color);
}

/* ===== LOADING STATES ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-surface) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== UTILITY CLASSES ===== */
.text-primary-custom {
    color: var(--primary) !important;
}

.bg-primary-light {
    background-color: var(--primary-light) !important;
}

.border-primary-custom {
    border-color: var(--primary) !important;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
}

/* ===== SMOOTH SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-hover);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== FOCUS STATES (Accessibility) ===== */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar, .navbar, .btn {
        display: none;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}
/* ===== UI POLISH: TYPOGRAPHY, SECTIONS, BADGES, CARDS, UTILITIES ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 800;
    margin-bottom: .5rem;
    letter-spacing: -0.2px;
}
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.5px; }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: clamp(20px, 2.5vw, 28px); }
.lead { color: var(--text-secondary); font-weight: 400; }

.section, .section-default { padding: 64px 0; }
.section-tight { padding: 40px 0; }

.badge-soft {
    background-color: rgba(0,0,0,0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.badge-chip {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 999px;
    padding: .35rem .75rem;
    font-size: 12px;
}

.card-elevated { box-shadow: var(--shadow-md) !important; }
.card-cta { border: 2px solid var(--primary); }
.card-cta .card-header {
    background: linear-gradient(135deg, var(--primary) 0%, #22C55E 100%) !important;
    color: #fff !important;
}
.service-card {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.btn-lg { padding: 0.875rem 1.25rem; border-radius: 10px; }
.btn-light { background: #fff; color: #1A202C; border: 1px solid rgba(0,0,0,0.08); }
.btn-outline-light { border: 1px solid rgba(255,255,255,0.5); color: #fff; }

.gap-8 { gap: 0.5rem; }
.gap-12 { gap: 0.75rem; }
.gap-16 { gap: 1rem; }
.rounded-12 { border-radius: 12px; }
.rounded-16 { border-radius: 16px; }

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 1rem;
}
.hero-badges .badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

.navbar-custom {
    backdrop-filter: saturate(180%) blur(6px);
}
.footer-custom small, .footer-custom p {
    color: rgba(255,255,255,0.75);
}

@media (max-width: 576px) {
    .btn-lg { font-size: 0.95rem; }
    .hero-section { padding: 72px 0 64px; }
}

/* ===== ALERT ACCENT HELPERS ===== */
.alert-accent-left-success { border-left: 4px solid var(--success) !important; }
.alert-accent-left-info { border-left: 4px solid var(--info) !important; }
.alert-accent-left-warning { border-left: 4px solid var(--warning) !important; }
.alert-accent-left-danger { border-left: 4px solid var(--danger) !important; }
.alert-accent-left-primary { border-left: 4px solid #1565C0 !important; }

/* Small rounding utility */
.rounded-12 { border-radius: 12px !important; }
