/* Custom CSS for CATRA Dashboard */

/* Main layout styling */
.bg-light {
    background-color: #f8f9fa !important;
}

/* Sidebar navigation */
.nav-pills .nav-link.active {
    background-color: #007bff;
    color: white;
}

.nav-pills .nav-link {
    color: #495057;
    margin-bottom: 5px;
    border-radius: 5px;
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: #e9ecef;
}

/* Card styling */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.card-title {
    font-size: 2rem;
    font-weight: bold;
}

/* Graph containers */
.js-plotly-plot {
    width: 100% !important;
}

/* Sankey diagram specific height control */
#sankey-diagram .js-plotly-plot {
    height: 700px !important;
    max-height: 700px !important;
}

#sankey-diagram .js-plotly-plot .plotly {
    height: 700px !important;
}

/* Sankey legend specific styling */
#sankey-legend {
    margin-top: 20px;
    margin-bottom: 40px;
}

#sankey-legend .js-plotly-plot {
    width: 100% !important;
}

/* Ensure proper spacing between sections */
.mb-4 {
    margin-bottom: 2rem !important;
}

/* Other graphs - prevent infinite growth but allow normal sizing */
.js-plotly-plot:not(#sankey-diagram .js-plotly-plot) .plotly {
    height: auto !important;
    max-height: 600px;
}

/* Graph wrapper div styling */
div[data-dash-is-loading="true"] {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom colors for KPI cards */
.text-primary {
    color: #007bff !important;
}

.text-info {
    color: #17a2b8 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-success {
    color: #28a745 !important;
}

/* Dropdown styling */
.Select-control {
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        height: auto !important;
        position: relative;
    }

    .main-content {
        width: 100% !important;
    }
}

/* Loading spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

/* Header styling */
h1, h2, h3, h4 {
    color: #343a40;
}

.lead {
    font-size: 1.1rem;
    color: #4c357d;
}

/* Table styling */
table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
}

/* Button styling */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}