:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --info-color: #4895ef;
    --warning-color: #f72585;
    --danger-color: #b5179e;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --card-bg: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
    padding-bottom: 20px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

.card-header.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px 12px 0 0 !important;
}

/* KPI Cards */
.kpi-card {
    border-radius: 12px;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.kpi-card h5 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.kpi-card h6 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

/* Chart Containers */
.chart-container {
    height: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 200px;
    }
}

/* Stat Cards */
.stat-card {
    padding: 10px;
}

.stat-card i {
    margin-bottom: 10px;
}

.stat-card h4 {
    font-weight: 700;
    margin: 5px 0;
    font-size: 1.5rem;
}

.stat-card small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner.hidden {
    display: none;
}

/* Table Styles */
.table-responsive {
    border-radius: 8px;
}

.table-hover tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.table th, .table td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

/* Form Controls */
.form-select, .form-control {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 10px;
    }
    
    .kpi-card .card-body h5 {
        font-size: 1rem;
    }
    
    .stat-card h4 {
        font-size: 1.3rem;
    }
    
    .card-header h5 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .kpi-card {
        min-height: 100px;
    }
    
    .kpi-card .card-body h5 {
        font-size: 0.9rem;
    }
    
    .stat-card h4 {
        font-size: 1.2rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Badge Styles */
.badge {
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Comparison modal styles */
.comparison-card {
    transition: all 0.3s ease;
    height: 100%;
}

.comparison-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Enhanced table styles */
.table-hover tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.15) !important;
}

/* Mobile-specific optimizations */
@media (max-width: 576px) {
    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

/* Print styles */
@media print {
    .navbar, .btn, .modal, .loading-spinner {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
    }
}
