.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 - 45px - 16px);
    padding: 10px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.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-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;
}

.analytics-layout {
    display: flex;
    flex: 1;
    align-items: stretch;
    min-height: 0;
    position: relative;
}

.analytics-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.search-panel {
    position: fixed;
    left: 0;
    top: 8vh;
    bottom: 0;
    width: 350px;
    background-color: #1a1a1a;
    border-right: 1px solid #333;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.search-panel.open {
    transform: translateX(0);
}

.panel-toggle-arrow {
    position: fixed;
    left: -13px;
    top: calc(8vh + 30px);
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: #2a2a2a;
    border: 1px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: left 0.3s ease, background-color 0.2s ease, border-color 0.2s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.panel-toggle-arrow:hover {
    background-color: #333;
    border-color: #444;
}

.panel-toggle-arrow i {
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-left: 4px;
}

.search-panel.open~.panel-toggle-arrow {
    left: 330px;
}

.search-panel-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.search-panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.search-panel-header h4 {
    color: #ead55b;
    margin: 0;
    font-size: 18px;
    text-align: center;
}

.search-control-group {
    margin-bottom: 25px;
}

.search-control-group:last-child {
    margin-bottom: 0;
}

.search-separator {
    height: 1px;
    background-color: #333;
    margin: 25px 0;
}

.search-actions {
    margin-top: 20px;
}

.search-go-btn {
    width: 100%;
    background-color: #ead55b;
    border-color: #ead55b;
    color: #1a1a1a;
    font-weight: 600;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.search-go-btn:hover {
    background-color: #f4e37a;
    border-color: #f4e37a;
    color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(234, 213, 91, 0.3);
}

.search-go-btn:disabled {
    background-color: #666;
    border-color: #666;
    color: #aaa;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.control-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff;
    font-size: 14px;
}

.form-select,
.form-control {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: white;
    border-radius: 6px;
}

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

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

.professor-search-container {
    position: relative;
}

.professor-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.professor-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    color: white;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s ease;
}

.professor-dropdown-item:hover,
.professor-dropdown-item.highlighted {
    background-color: #444;
}

.professor-dropdown-item:last-child {
    border-bottom: none;
}

.professor-dropdown-empty {
    padding: 10px 12px;
    color: #888;
    font-style: italic;
    text-align: center;
}

.no-results-message {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    padding: 8px 10px;
    background-color: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #444;
}

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

.initial-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
}

.initial-state-content {
    text-align: center;
    max-width: 400px;
}

.initial-state-icon {
    font-size: 4rem;
    color: #444;
    margin-bottom: 20px;
}

.initial-state-title {
    color: #ead55b;
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.initial-state-description {
    color: #aaa;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 80%;
    height: auto;
    z-index: 10;
    background-color: transparent;
    border-radius: 8px;
}

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

.professor-profile {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

.professor-header {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    flex-shrink: 0;
    margin-bottom: 10px;
    /* Explicit margin to ensure gap is visible */
}

.professor-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.professor-name-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.professor-name {
    color: #ead55b;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
    flex-shrink: 0;
}

.professor-header-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.professor-time-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-filter-label {
    font-size: 0.9rem;
    color: #aaa;
    white-space: nowrap;
}

.professor-time-select {
    min-width: 140px;
    font-size: 0.85rem;
    padding: 6px 10px;
}

.professor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.professor-link {
    color: #aaa;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 10px;
    border: 1px solid #444;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.professor-link:hover {
    color: #ead55b;
    border-color: #ead55b;
    text-decoration: none;
}

.professor-content-layout {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 8vh - 45px - 16px - 75px - 15px);
}

.professor-info-column {
    flex: 0 0 min(351px, 34.125vw);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    height: 100%;
}

.professor-chart-column {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
}
.info-panel,
.stats-panel,
.chart-panel {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chart-panel-large {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-title {
    color: #ead55b;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
}
.gpa-stats-separator {
    height: 1px;
    background-color: #333;
    margin: 10px -15px 8px -15px;
    position: relative;
    flex-shrink: 0;
}

.gpa-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.gpa-stat-item {
    flex: 1;
    text-align: center;
}

.gpa-stat-label {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.gpa-stat-value {
    font-size: 1rem;
    color: white;
    font-weight: 500;
}
.departments-container {
    position: relative;
    width: 100%;
    min-height: 1.2em; /* Changed from fixed height to min-height */
    overflow: visible; /* Changed from hidden to visible */
}

.departments-display {
    width: 100%;
    line-height: 1.4; /* Better line spacing for vertical list */
    transition: all 0.2s ease;
    /* Removed white-space: nowrap and text-overflow: ellipsis for vertical display */
}

.departments-display.has-more {
    cursor: help;
}

.departments-display.has-more:hover {
    color: #ead55b;
}
.more-departments {
    color: #ead55b;
    font-style: italic;
    cursor: help;
}

.more-departments:hover {
    color: #f4e37a;
}
.departments-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.85rem;
    color: white;
    white-space: pre-line; /* Changed to preserve line breaks */
    word-wrap: break-word;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 200px; /* Add max height for very long lists */
    overflow-y: auto; /* Add scroll if needed */
}

.departments-container.has-more:hover .departments-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    color: white;
    font-weight: 500;
}
.stats-grid {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ead55b;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.stat-label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.gpa-excellent {
    color: #4CAF50 !important;
    /* Green */
}

.gpa-good {
    color: #8BC34A !important;
    /* Light Green */
}

.gpa-average {
    color: #ead55b !important;
    /* Yellow */
}

.gpa-below-average {
    color: #FF9800 !important;
    /* Orange */
}
.stat-positive {
    color: #4CAF50 !important;
    /* Green for above average */
}

.stat-negative {
    color: #f44336 !important;
    /* Red for below average */
}
.chart-container-small {
    position: relative;
    height: 180px;
    width: 100%;
    padding: 0;
    flex: 1;
    min-height: 0;
}

.chart-container-large {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
}

.chart-container-small canvas,
.chart-container-large canvas {
    background-color: #121212;
    border-radius: 8px;
}
.error-message {
    background-color: #2a1a1a;
    border: 1px solid #d63384;
    border-radius: 10px;
    padding: 20px;
    color: #f8d7da;
    text-align: center;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 200px;
}

.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);
    }
}
.analytics-footer {
    color: #707070;
    text-align: center;
    padding: 12px 20px;
    font-size: clamp(11px, .6vw, 13px);
    background-color: #121212;
    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;
}
@media (max-width: 1400px) {
    .professor-info-column {
        flex: 0 0 min(312px, 31.2vw);
        /* Reduced by 2.5%: 320px * 0.975 = 312px, 32vw * 0.975 = 31.2vw */
    }
}

@media (max-width: 1200px) {
    .professor-content-layout {
        flex-direction: column;
        height: auto;
    }

    .professor-info-column {
        flex: none;
        height: auto;
        flex-direction: row;
        gap: 15px;
    }

    .professor-chart-column {
        height: 400px;
        flex-shrink: 0;
    }

    .info-panel,
    .chart-panel {
        flex: 1;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-height: 800px) {
    .analytics-container {
        padding: 8px;
        gap: 8px;
    }

    .professor-header {
        padding: 12px;
    }

    .info-panel,
    .stats-panel,
    .chart-panel,
    .chart-panel-large {
        padding: 12px;
    }

    .professor-content-layout {
        height: calc(100vh - 8vh - 45px - 12px - 60px - 35px);
        /* 100vh - navbar - footer - reduced padding - reduced header - margins (increased height) */
    }
}

@media (max-width: 480px) {
    .analytics-container {
        padding: 10px;
    }

    .analytics-controls {
        padding: 15px;
    }

    .professor-header {
        padding: 15px;
    }

    .info-panel,
    .stats-panel,
    .chart-panel,
    .chart-panel-large {
        padding: 15px;
    }
}