/************************************************* spreadsheet.css ***************************************************/
/***************************************************************************************************************************/

.frozen-spreadsheet-container {
    width: 100%;
    /* Allow height to be controlled by inline style (from renderer). Provide a sensible minimum. */
    min-height: 400px;
    background: white;
    border: 1px solid #ccc;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    margin-top: 12px;
}

/* Utility: full-bleed element that cancels out container gutters so
   components can span the full viewport width while remaining responsive.
   Uses Bootstrap's --bs-gutter-x variable when available, falls back to 15px. */
.full-bleed {
    margin-left: calc(-1 * var(--bs-gutter-x, 15px));
    margin-right: calc(-1 * var(--bs-gutter-x, 15px));
    width: calc(100% + 2 * var(--bs-gutter-x, 15px));
    /* Keep content from touching the viewport edges */
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

.frozen-spreadsheet-wrapper {
    display: grid;
    grid-template-areas: 
        "corner header"
        "sidebar content";
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr;
    width: 100%;
    height: 100%;
}

.fs-corner-cell {
    grid-area: corner;
    background-color: #e8e8e8;
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding: 0 10px;
    position: relative;
    z-index: 4;
}

.fs-header-row {
    grid-area: header;
    background-color: #e8e8e8;
    border-bottom: 1px solid #aaa;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    z-index: 2;
}

.fs-header-content {
    display: flex;
    width: max-content;
    min-width: 100%;
    min-height: 50px;
    height: auto;
}

.fs-header-cell {
    width: 100px;
    min-width: 100px;
    flex-shrink: 0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-right: 1px solid #ccc;
    text-align: center;
    font-size: 12px;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
}

/* Grouped header band support */
.fs-header-group-row { display: flex; width: max-content; min-width: 100%; }
.fs-group-cell { flex-shrink: 0; text-align: center; font-weight: 600; font-size: 12px; border-right: 1px solid #ccc; padding: 6px 8px; background: #ddd; }

/* Rotated attribute group labels */
.fs-header-group-row.rotate-groups { min-height: 120px; }
.fs-header-group-row.rotate-groups .fs-group-cell { display: flex; align-items: center; justify-content: flex-end; }
.fs-header-group-row.rotate-groups .fs-group-cell .group-label { transform: rotate(-90deg); transform-origin: bottom left; white-space: nowrap; display: inline-block; }

/* Header wrapping (no rotation) */
.fs-header-cell { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
.fs-header-cell .header-main { white-space: normal; word-break: break-word; }

.fs-header-cell .header-main {
    font-size: 14px;
    margin-bottom: 2px;
}

.fs-header-cell .header-sub {
    font-size: 10px;
    color: #666;
    font-weight: normal;
}

.fs-first-column {
    grid-area: sidebar;
    background-color: #f9f9f9;
    border-right: 1px solid #aaa;
    overflow-y: scroll;
    overflow-x: hidden;
    position: relative;
    z-index: 3;
    scrollbar-width: none;
}

.fs-first-column::-webkit-scrollbar {
    display: none;
}

.fs-first-column-content {
    display: flex;
    flex-direction: column;
}

.fs-row-header {
    min-height: 50px;
    height: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    border-bottom: 1px solid #aaa;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.fs-row-header .row-main {
    font-weight: bold;
    font-size: 13px;
    color: #333;
}

.fs-row-header .row-sub {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.fs-content-area {
    grid-area: content;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.fs-content-grid {
    display: flex;
    flex-direction: column;
    width: max-content;
    min-width: 100%;
}

.fs-data-row {
    display: flex;
    min-height: 50px;
    height: auto;
    border-bottom: 1px solid #aaa;
}

.fs-data-cell {
    width: 100px;
    min-width: 100px;
    flex-shrink: 0;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #ccc;
    font-weight: normal;
    font-size: 14px;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
    text-align: center;
}

.fs-data-cell.clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.fs-data-cell.clickable:hover {
    background-color: #f0f0f0;
}

/* Color coding for levels */
.fs-data-cell.level-I { color: #2196F3; }
.fs-data-cell.level-D { color: #FF9800; }
.fs-data-cell.level-A { color: #4CAF50; }

/* Data cell styling for course-indicator mapping */
#fs_course_indicators_table_content .fs-data-cell {
    text-align: center;
    font-weight: bold;
    user-select: none;
}

#fs_course_indicators_table_content .fs-data-cell:hover {
    background-color: #fffacd;
    cursor: pointer;
}

.level-I { color: #2196F3; }
.level-D { color: #FF9800; }
.level-A { color: #4CAF50; }

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Hide the horizontal scrollbar on the data/content area while keeping
   the vertical scrollbar visible. This hides the UI in WebKit browsers
   (Chrome, Edge, Safari). Firefox doesn't support horizontal-only
   scrollbar hiding; users can still scroll vertically with wheel/touch.
*/
.fs-content-area::-webkit-scrollbar:horizontal {
    height: 0px;
}
.fs-content-area {
    -ms-overflow-style: auto; /* IE/Edge */
    scrollbar-width: auto;    /* Firefox */
}

/* ── Selectable (checkbox) column ── */
.frozen-spreadsheet-wrapper.has-selection {
    grid-template-areas:
        "select-corner corner header"
        "select-col sidebar content";
}

/* Selection + row groups combined */
.frozen-spreadsheet-wrapper.has-selection.has-row-groups {
    grid-template-areas:
        "select-corner rowgroup-corner corner header"
        "select-col rowgroups sidebar content";
}

.fs-select-corner {
    grid-area: select-corner;
    background-color: #e8e8e8;
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.fs-select-corner input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0d6efd;
}

.fs-select-column {
    grid-area: select-col;
    background-color: #f9f9f9;
    border-right: 1px solid #aaa;
    overflow-y: scroll;
    overflow-x: hidden;
    position: relative;
    z-index: 3;
    scrollbar-width: none;
}

.fs-select-column::-webkit-scrollbar {
    display: none;
}

.fs-select-column-content {
    display: flex;
    flex-direction: column;
}

.fs-select-cell {
    min-height: 50px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #aaa;
    box-sizing: border-box;
}

.fs-select-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0d6efd;
}

/* Highlight row when checked */
.fs-select-cell.fs-row-checked {
    background-color: #e7f1ff;
}

/* Selected row highlight applied to row header and data row */
.fs-row-header.fs-row-selected {
    background-color: rgba(231, 241, 255, 0.6) !important;
}

.fs-data-row.fs-row-selected {
    background-color: rgba(231, 241, 255, 0.6) !important;
}

/* ── Row group column (vertical equivalent of header groups) ── */
.frozen-spreadsheet-wrapper.has-row-groups {
    grid-template-areas:
        "rowgroup-corner corner header"
        "rowgroups sidebar content";
}

.fs-row-group-corner {
    grid-area: rowgroup-corner;
    background-color: #e8e8e8;
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
    position: relative;
    z-index: 5;
}

.fs-row-group-column {
    grid-area: rowgroups;
    background-color: #f0f0f0;
    border-right: 1px solid #aaa;
    overflow-y: scroll;
    overflow-x: hidden;
    position: relative;
    z-index: 4;
    scrollbar-width: none;
}

.fs-row-group-column::-webkit-scrollbar {
    display: none;
}

.fs-row-group-content {
    display: flex;
    flex-direction: column;
}

.fs-row-group-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: normal;
    font-size: 14px;
    padding: 4px 2px;
    border-bottom: 1px solid #aaa;
    background: #e2e6ea;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.3;
}

.fs-row-group-cell .rg-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}