.analytics-body {
    background-color: #121212;
    color: white;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.analytics-navbar {
    background-color: #1a1a1a !important;
    border-bottom: 1px solid #333 !important;
    padding: 10px 20px !important;
    height: 8vh !important;
    min-height: 60px !important;
    flex-shrink: 0;
}

.analytics-container {
    height: calc(100vh - 8vh - 60px); /* Total height minus navbar minus footer */
    padding: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.analytics-navbar .navbar-brand {
    color: white !important;
    background-color: transparent !important;
    border: none !important;
}

.analytics-navbar .navbar-brand:hover {
    color: #ead55b !important;
    background-color: transparent !important;
}

.analytics-navbar .nav-link {
    color: white !important;
    background-color: transparent !important;
    border: none !important;
}

.analytics-navbar .nav-link:hover {
    color: #ead55b !important;
    background-color: transparent !important;
}

.analytics-navbar .nav-link:focus {
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

.analytics-navbar .dropdown-item {
    background-color: #1a1a1a !important;
    color: white !important;
}

.analytics-navbar .dropdown-item:hover {
    background-color: #333 !important;
    color: #ead55b !important;
}

.analytics-navbar .dropdown-item.active {
    background-color: #333 !important;
    color: #ead55b !important;
}

.analytics-navbar .dropdown-menu {
    background-color: #1a1a1a !important;
    border: 1px solid #333 !important;
}

.analytics-navbar .dropdown-toggle::after {
    display: inline-block !important;
    margin-left: 0.255em !important;
    vertical-align: 0.255em !important;
    content: "" !important;
    border-top: 0.3em solid !important;
    border-right: 0.3em solid transparent !important;
    border-bottom: 0 !important;
    border-left: 0.3em solid transparent !important;
}

/* Chart Controls - positioned inside chart area */
.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: rgba(26, 26, 26, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.chart-controls-left {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.chart-controls-right {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.control-label-inline {
    display: block;
    font-weight: 500;
    color: #fff;
    font-size: 16px;
    white-space: nowrap;
    margin: 0;
}

/* Underline the Analysis Type label (first control group) */
.chart-controls-left .control-group:first-child .control-label-inline {
    text-decoration: underline;
    text-decoration-color: white;
    text-underline-offset: 3px;
}

.form-select-inline {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: white;
    border-radius: 6px;
    font-size: 15px;
    padding: 8px 12px;
    min-width: 200px;
    position: relative;
    z-index: 100;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.form-select-inline:focus {
    border-color: #3a3a3a !important;
    box-shadow: none !important;
    background-color: #2a2a2a;
    outline: none !important;
}

.form-select-inline option {
    background-color: #2a2a2a;
    color: white;
}

.form-select-inline optgroup {
    background-color: #1a1a1a;
    color: #ead55b;
    font-weight: bold;
    font-style: normal;
}

.form-select-inline optgroup option {
    background-color: #2a2a2a;
    color: white;
    font-weight: normal;
    padding-left: 20px;
}

.cache-indicator-inline {
    font-size: 11px;
    color: #888;
    padding: 5px 8px;
    background-color: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #444;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive design for smaller screens */
@media (max-width: 1200px) {
    .chart-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .chart-controls-left,
    .chart-controls-right {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .chart-controls-left,
    .chart-controls-right {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .form-select-inline {
        min-width: auto;
        width: 100%;
    }
}

/* Remove the old bottom controls styles */

.controls-row {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    flex: 1;
}

.control-item.cache-item {
    min-width: auto;
    flex: 0;
    justify-content: flex-end;
}

.control-label {
    display: block;
    font-weight: 500;
    color: #fff;
    font-size: 16px;
    white-space: nowrap;
    margin: 0;
}

/* Underline the Analysis Type label (first control item) */
.controls-row .control-item:first-child .control-label {
    text-decoration: underline;
    text-decoration-color: white;
    text-underline-offset: 3px;
}

/* Disabled state for controls during loading */
.chart-controls.controls-disabled {
    opacity: 0.55;
}

/* Block interactions without using native disabled styling */
.chart-controls.controls-disabled * {
    pointer-events: none !important;
}

/* Override form control colors to keep dark theme when visually disabled */
.chart-controls.controls-disabled .form-select-inline {
    background-color: #2a2a2a !important;
    color: #aaa !important;
    border-color: #444 !important;
}

.form-check-label {
    color: #ccc;
    margin-left: 5px;
}

.form-check-input:checked {
    background-color: #ead55b;
    border-color: #ead55b;
}

.cache-indicator {
    font-size: 11px;
    color: #888;
    margin-top: 10px;
    padding: 5px 8px;
    background-color: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #444;
}

.chart-container {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    margin-top: 0px;
    background: var(--bg-secondary, #121212);
    border-radius: 8px;
    border: 1px solid #3a3a3a;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    min-height: 0;
}

.chart-wrapper::before {
    content: none;
}

.chart-canvas {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 400px;
    max-width: 100%;
    background-color: #121212;
    border-radius: 6px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    box-sizing: border-box;
}

.chart-canvas[style*="display: none"] {
    background-color: transparent;
}

/* Horizontal bar chart specific styles */
.chart-wrapper.horizontal-bars .chart-canvas {
    width: 100% !important;
    height: auto !important;
}

.chart-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    margin-top: 0px;
    width: 100%;
}

.chart-title {
    color: #ead55b;
    font-size: 1.6vw;
    font-weight: 500;
    margin: 0;
}

.chart-info {
    color: #aaa;
    font-size: 14px;
    margin-top: 5px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: auto;
    z-index: 10;
    background-color: transparent;
    border-radius: 8px;
}

.loading-text {
    color: #ead55b;
    font-size: 16px;
    font-weight: 500;
}

.error-message {
    background-color: #2a1a1a;
    border: 1px solid #d63384;
    border-radius: 10px;
    padding: 20px;
    color: #f8d7da;
    text-align: center;
    margin: 20px 0;
}

.error-icon {
    font-size: 24px;
    margin-bottom: 10px;
    color: #d63384;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.chart-tooltip {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    color: white;
    max-width: 200px;
}

.analytics-footer {
    color: #707070;
    text-align: center;
    padding: 8px 20px;
    font-size: clamp(11px, .6vw, 13px);
    background-color: #121212;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.analytics-footer span {
    color: white;
}

.analytics-footer div {
    font-size: 12px;
    margin-top: 5px;
    color: #6c757d;
}

/* Major-specific styling */
.major-heatmap-cell {
    transition: all 0.3s ease;
    cursor: pointer;
}

.major-heatmap-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(234, 213, 91, 0.3);
}

.major-trend-line {
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.major-performance-bar {
    transition: all 0.3s ease;
}

.major-performance-bar:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Growth Trends Controls */
.growth-trends-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background-color: rgba(26, 26, 26, 0.95);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 8px;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.growth-mode-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-type-toggle {
    margin-left: 8px;
    transition: opacity 0.3s ease;
}

.data-type-toggle.chart-top-left {
    position: absolute;
    top: 25px;
    left: 40px;
    z-index: 10;
    margin-left: 0;
}

.data-type-toggle.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: relative;
    display: flex;
    align-items: center;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 16px;
    padding: 2px;
    cursor: pointer;
    font-size: 11px;
    min-width: 111px; /* Increased from 101px by 10% (101 × 1.1 = 111.1px) */
    height: 28px;
    transition: all 0.3s ease;
}

.toggle-label:hover {
    border-color: #ead55b;
}

.toggle-option {
    position: relative;
    z-index: 2;
    padding: 4px 8px;
    color: #ccc;
    transition: color 0.3s ease;
    flex: 1;
    text-align: center;
    font-weight: 500;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: #ead55b;
    border-radius: 12px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(calc(100% - 1px));
}

/* Reset any potential conflicting styles and force color changes */
.data-type-toggle .toggle-option {
    color: #ccc !important;
}

/* When checked (Total is selected) - slider moves right */
.toggle-input:checked + .toggle-label .toggle-option:nth-child(1) {
    color: #ccc !important;
}

.toggle-input:checked + .toggle-label .toggle-option:nth-child(2) {
    color: #000 !important;
}

/* When not checked (% is selected) - slider on left */
.toggle-input:not(:checked) + .toggle-label .toggle-option:nth-child(1) {
    color: #000 !important;
}

.toggle-input:not(:checked) + .toggle-label .toggle-option:nth-child(2) {
    color: #ccc !important;
}

.enrollment-change-type {
    min-width: 70px;
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #fff;
    transition: all 0.2s ease;
}

.enrollment-change-type:focus {
    outline: none;
    border-color: #ead55b;
    box-shadow: 0 0 5px rgba(234, 213, 91, 0.3);
}

.growth-data-type-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #444;
}

.growth-data-type-selector .control-label-inline {
    font-size: 12px;
    color: #ccc;
    margin: 0;
}

.growth-data-type-selector .form-select-inline {
    font-size: 12px;
    padding: 4px 8px;
    min-width: 140px;
    padding-right: 1.5rem;
    background-size: 12px 9px;
}

.growth-mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.growth-mode-option input[type="radio"] {
    display: none;
}

.growth-mode-bubble {
    background-color: #2a2a2a;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.growth-mode-option input[type="radio"]:checked + .growth-mode-bubble {
    background-color: #ead55b;
    color: #121212;
    border-color: #ead55b;
    box-shadow: 0 2px 4px rgba(234, 213, 91, 0.3);
}

.growth-mode-bubble:hover {
    background-color: #3a3a3a;
    border-color: #555;
}

.growth-mode-option input[type="radio"]:checked + .growth-mode-bubble:hover {
    background-color: #f4e37a;
    border-color: #f4e37a;
}



/* Legend cursor styling for interactive legend items */
.chart-canvas {
    cursor: default;
}