/* CAS Section Consolidation Explorer - Custom CSS
 * Design: Professional, refined, less overwhelmingly orange
 */

/* Root variables */
:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --primary-dark: #1a252f;
    --accent: #e67e22;
    --accent-light: #f39c12;
    --accent-dark: #d35400;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-muted: #95a5a6;
    --background: #ffffff;
    --background-alt: #f8f9fa;
    --border: #dfe6e9;
}

/* Base styles */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-alt);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* Sidebar container */
.sidebar {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    padding: 1.5rem 1.25rem 1.5rem 1rem;
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Ensure filter groups don't overflow */
.sidebar .filter-group {
    width: 100%;
    box-sizing: border-box;
}

.sidebar-brand {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.sidebar-brand-underline {
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    width: 60px;
    margin-bottom: 1rem;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-top: 0.5rem;
}

/* Filter labels */
.filter-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    display: block;
}

.filter-group {
    margin-bottom: 1rem;
}

/* Checklist/Listbox styling for sidebar filters */
.filter-listbox-container {
    background-color: white;
    border-radius: 4px;
    padding: 6px 8px 6px 8px !important;
}

.filter-checklist {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.filter-checklist .form-check {
    margin-bottom: 0;
    padding: 5px 8px 5px 32px;
    border-radius: 3px;
    transition: background-color 0.15s;
    position: relative;
    min-height: 28px;
    display: flex;
    align-items: center;
}

.filter-checklist .form-check-input {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-checklist .form-check:hover {
    background-color: var(--background-alt);
}

.filter-checklist .form-check-label {
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    padding-left: 0;
    margin-left: 0;
    line-height: 1.3;
}

.filter-checklist .form-check-input:checked {
    background-color: var(--info);
    border-color: var(--info);
}

/* Dropdown styling for sidebar */
.filter-dropdown {
    background-color: white;
    border-radius: 4px;
}

/* Regular dropdown styling in sidebar */
.sidebar .Select-control,
.sidebar .dash-dropdown .Select-control {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.sidebar .Select-menu-outer,
.sidebar .dash-dropdown .Select-menu-outer {
    background-color: white;
    color: var(--text-primary);
}

.sidebar .Select-option,
.sidebar .dash-dropdown .Select-option {
    color: var(--text-primary);
    background-color: white;
}

.sidebar .Select-option.is-focused,
.sidebar .dash-dropdown .Select-option.is-focused {
    background-color: var(--background-alt);
}

.sidebar .Select-option.is-selected,
.sidebar .dash-dropdown .Select-option.is-selected {
    background-color: var(--info);
    color: white;
}

.sidebar .Select-value-label,
.sidebar .Select-placeholder {
    color: var(--text-primary);
}

/* Buttons */
.btn-reset {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    width: 100%;
    transition: all 0.2s;
}

.btn-reset:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Main content area */
.main-content {
    padding: 1.5rem 2rem;
    background-color: var(--background);
    min-height: 100vh;
}

.page-title {
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Tabs styling */
.custom-tabs .nav-tabs {
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.custom-tabs .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    transition: all 0.2s;
}

.custom-tabs .nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--border);
}

.custom-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

/* KPI Cards */
.kpi-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--info);
    margin-bottom: 1rem;
}

.kpi-card.accent {
    border-left-color: var(--accent);
}

.kpi-card.success {
    border-left-color: var(--success);
}

.kpi-card.warning {
    border-left-color: var(--warning);
}

.kpi-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-value {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 600;
}

.kpi-change {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

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

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

/* Control bar */
.control-bar {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background-color: var(--background-alt);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.control-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Configuration panel */
.config-panel {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.config-panel-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

/* Sliders */
.slider-container {
    margin-bottom: 1.25rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-label-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.slider-value {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Charts container */
.chart-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Results section */
.results-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 1.5rem;
    border-top: 4px solid var(--accent);
}

.results-title {
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Simulation button */
.btn-simulate {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-simulate:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

.btn-simulate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Progress indicator */
.progress-container {
    margin-top: 1rem;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* Footer */
.sidebar-footer {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-footer-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-align: center;
}

/* Comparison table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.comparison-table th {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.comparison-table tr:hover {
    background-color: var(--background-alt);
}

.value-positive {
    color: var(--success);
    font-weight: 600;
}

.value-negative {
    color: var(--danger);
    font-weight: 600;
}

/* User guide section */
.user-guide {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-guide h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.user-guide h3 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.user-guide p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.user-guide ul {
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        min-height: auto;
    }

    .main-content {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 0;
    }

    .btn-simulate,
    .btn-reset {
        display: none;
    }
}
