/* OSU-OKC Enrollment Analysis - Design Guidelines Compliant */

:root {
    /* Layout */
    --sidebar-width: 220px;
    --sidebar-font-size: 0.8rem;

    /* Neutral colors - using rgba for theme compatibility */
    --border-color: rgba(0, 0, 0, 0.1);
    --muted-text: rgba(0, 0, 0, 0.5);
    --bg-light: rgba(0, 0, 0, 0.02);

    /* Tableau 10 Palette */
    --palette-1: #4e79a7;  /* Blue - Current state */
    --palette-2: #f28e2b;  /* Orange - Target state */
    --palette-3: #e15759;  /* Red - Negative/cuts */
    --palette-4: #76b7b2;  /* Teal - Neutral */
    --palette-5: #59a14f;  /* Green - Positive/savings */
    --palette-6: #edc948;  /* Yellow - Warning */

    /* Semantic aliases */
    --color-current: var(--palette-1);
    --color-target: var(--palette-2);
    --color-negative: var(--palette-3);
    --color-positive: var(--palette-5);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* App Container - works with Bootstrap */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header */
.header {
    background: var(--palette-1);
    padding: 0.75rem 1.5rem;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Section Labels */
.section-label {
    font-size: var(--sidebar-font-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
    display: block;
}

/* Analysis Controls */
.analysis-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 180px;
}

.control-label {
    font-size: var(--sidebar-font-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-text);
}

.control-dropdown {
    font-size: 14px;
}

/* Filters Section */
.filters-section {
    margin-bottom: 0.75rem;
}

.filters-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 120px;
    flex: 1;
    max-width: 180px;
}

.filter-label {
    font-size: calc(var(--sidebar-font-size) - 0.1rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--muted-text);
}

.filter-dropdown {
    font-size: 13px;
}

/* Summary Section */
.summary-section {
    margin-bottom: 0.5rem;
}

.summary-stats {
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.stat-divider {
    color: var(--border-color);
    margin: 0 0.5rem;
}

/* Chart Container */
.chart-container {
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    min-width: 0;  /* Critical for flexbox responsiveness */
}

/* Grid Section */
.grid-section {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1rem;
}

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

.export-btn {
    background: var(--palette-1);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.export-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* AG Grid */
.ag-theme-alpine {
    --ag-font-size: 12px;
    --ag-row-height: 36px;
}

.ag-theme-alpine .ag-header-cell-label {
    white-space: normal;
    line-height: 1.3;
    font-weight: 600;
}

.ag-theme-alpine .ag-header-cell {
    padding-top: 6px;
    padding-bottom: 6px;
}

.ag-theme-alpine .ag-header-cell-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 11px;
}

/* AG Grid cell colors using palette */
.cell-cut {
    color: var(--palette-3) !important;
    font-weight: 600;
}

.cell-after {
    color: var(--palette-2) !important;
    font-weight: 600;
}

.cell-savings {
    color: var(--palette-5) !important;
    font-weight: 600;
}

/* Tabs */
.main-tabs {
    margin-bottom: 0.5rem;
}

.tab {
    padding: 0.75rem 1.5rem !important;
    font-size: 0.875rem !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    background: transparent !important;
    color: var(--muted-text) !important;
    transition: all 0.2s ease !important;
}

.tab:hover {
    background: var(--bg-light) !important;
}

.tab--selected {
    color: var(--palette-1) !important;
    border-bottom: 3px solid var(--palette-1) !important;
    font-weight: 600 !important;
}

.tab-content {
    padding-top: 0.5rem;
}

/* Consolidation Tab */
.consolidation-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.cost-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 180px;
}

.cost-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    min-width: 100px;
    height: 38px;
}

.cost-input:focus {
    outline: none;
    border-color: var(--palette-1);
}

.scope-toggles {
    display: flex;
    gap: 1.5rem;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.scope-toggle {
    display: flex;
    gap: 0.75rem;
}

.scope-toggle label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.scope-toggle input[type="radio"] {
    accent-color: var(--palette-1);
}

/* Summary Cards */
.consolidation-summary {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    position: relative;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.consolidation-summary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--palette-1);
    border-radius: 8px 8px 0 0;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: var(--sidebar-font-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-text);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-value.savings {
    color: var(--palette-5);
}

/* Small Sections Tab */
.small-sections-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.threshold-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.threshold-toggle label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.threshold-toggle input[type="radio"] {
    accent-color: var(--palette-1);
}

/* Severity color classes */
.severity-critical {
    background-color: rgba(231, 87, 89, 0.15);
    color: var(--palette-3);
    font-weight: bold;
}

.severity-warning {
    background-color: rgba(237, 201, 72, 0.2);
    color: #b8860b;
    font-weight: bold;
}

.severity-watch {
    background-color: rgba(78, 121, 167, 0.15);
    color: var(--palette-1);
    font-weight: bold;
}

/* Trends Tab */
.trend-direction-up {
    color: var(--palette-5);
    font-weight: 700;
}

.trend-direction-down {
    color: var(--palette-3);
    font-weight: 700;
}

.trend-direction-stable {
    color: var(--muted-text);
    font-weight: 600;
}

/* Impact Simulator Tab */
.simulator-intro {
    margin-bottom: 0.5rem;
}

.simulator-description {
    color: var(--muted-text);
    font-size: 0.85rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border-radius: 6px;
    border-left: 3px solid var(--palette-1);
}

/* Scenario Cards */
.scenario-cards-container {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.scenario-card {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    min-width: 0;
}

.scenario-card.current {
    border-color: var(--palette-1);
}

.scenario-card.target {
    border-color: var(--palette-2);
}

.scenario-card.optimized {
    border-color: var(--palette-5);
}

.scenario-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.scenario-card.current .scenario-title {
    color: var(--palette-1);
}

.scenario-card.target .scenario-title {
    color: var(--palette-2);
}

.scenario-card.optimized .scenario-title {
    color: var(--palette-5);
}

.scenario-arrow {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    color: var(--border-color);
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: var(--sidebar-font-size);
}

.metric-label {
    color: var(--muted-text);
    white-space: nowrap;
}

.metric-value {
    font-weight: 700;
    text-align: right;
}

.metric-value.highlight {
    color: var(--palette-2);
}

.metric-value.savings {
    color: var(--palette-5);
}

.sections-cut-row {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.sections-cut-label {
    font-size: var(--sidebar-font-size);
    font-weight: 600;
    color: var(--palette-2);
}

/* Slider Styles */
.slider-container {
    background: white;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

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

.slider-label {
    font-size: 0.9rem;
    font-weight: 700;
}

.slider-max-label {
    font-size: var(--sidebar-font-size);
    color: var(--muted-text);
    font-weight: 600;
}

/* Slider customization */
.rc-slider-track {
    background-color: var(--palette-1) !important;
}

.rc-slider-handle {
    border-color: var(--palette-1) !important;
}

.rc-slider-handle:hover,
.rc-slider-handle:active {
    border-color: var(--palette-1) !important;
    box-shadow: 0 0 0 5px rgba(78, 121, 167, 0.2) !important;
}

.rc-slider-rail {
    background-color: var(--border-color) !important;
}

.rc-slider-dot-active {
    border-color: var(--palette-1) !important;
}

.rc-slider-mark-text {
    color: var(--muted-text) !important;
    font-size: 0.75rem !important;
}

/* Sliders Row */
.sliders-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.slider-half {
    flex: 1;
    min-width: 0;  /* Critical for flex responsiveness */
}

.slider-half .slider-container {
    margin-bottom: 0;
    height: 100%;
}

/* Course Breakdown Grid */
.course-breakdown-container {
    background: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.course-breakdown-container .grid-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.course-breakdown-container .grid-subtitle {
    font-size: 0.85rem;
    color: var(--muted-text);
    margin-bottom: 1rem;
}

.breakdown-summary-container {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(78, 121, 167, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--palette-1);
}

.breakdown-summary {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Charts side by side */
.charts-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-half {
    flex: 1;
    min-width: 0;  /* Critical for flex responsiveness */
}

/* Responsive */
@media (max-width: 768px) {
    .analysis-controls {
        flex-direction: column;
    }

    .filters-container {
        flex-direction: column;
    }

    .filter-group {
        max-width: none;
    }

    .consolidation-controls {
        flex-direction: column;
    }

    .consolidation-summary {
        flex-direction: column;
        gap: 1rem;
    }

    .small-sections-controls {
        flex-direction: column;
    }

    .charts-row {
        flex-direction: column;
    }

    .scenario-cards-container {
        flex-direction: column;
    }

    .scenario-arrow {
        transform: rotate(90deg);
        justify-content: center;
        padding: 0.25rem 0;
    }

    .sliders-row {
        flex-direction: column;
    }
}
