/*
 * Table styles
 * - Handsontable overrides and layout for #slot-table and #results-table containers.
 * - Keep styles minimal and scoped to avoid leaking into other pages.
 */

.htCore td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#slot-table,
#sc-slot-table,
#results-table {
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex: 1;
}

#slot-table .handsontable,
#sc-slot-table .handsontable,
#results-table .handsontable {
    font-size: 14px;
}

#slot-table .handsontable th,
#sc-slot-table .handsontable th,
#results-table .handsontable th {
    background-color: #667eea;
    color: white;
    font-weight: bold;
}

#slot-table .handsontable td,
#sc-slot-table .handsontable td,
#results-table .handsontable td {
    padding: 8px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#slot-table .handsontable tr:nth-child(even) td,
#sc-slot-table .handsontable tr:nth-child(even) td,
#results-table .handsontable tr:nth-child(even) td {
    background-color: #f5f5f5;
}

#slot-table .handsontable tr:hover td,
#sc-slot-table .handsontable tr:hover td,
#results-table .handsontable tr:hover td {
    background-color: #e6e6fa;
}

/* Checkbox column styles */
.row-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Additional slot table styles */
.slot-table-container {
    margin-top: 2px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible; /* Changed to visible to ensure bottom controls are visible */
}

#slot-table,
#sc-slot-table,
#results-table {
    width: 100%;
    height: calc(100% - 80px);
    overflow: hidden; /* Let Handsontable manage scrolling to keep headers fixed */
}

/* Row header (line numbers) improvements */
#slot-table .handsontable .htRowHeader,
#sc-slot-table .handsontable .htRowHeader,
#results-table .handsontable .htRowHeader {
    white-space: nowrap;
    text-align: right;
    font-family: inherit; /* ensure same font metrics as data cells to match row height */
    font-weight: normal; /* avoid bold headers increasing line box height */
    line-height: inherit; /* match data cell line-height */
    padding: 8px 6px; /* match td vertical padding but keep narrower horizontal space */
}


/* Ensure Handsontable dropdown/filter menu appears above and is not clipped */
.htMenu,
.htDropdownMenu {
  z-index: 99999 !important;
}