/* Custom Stylesheet */

.summary-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.table-thumbnail {
    height: 40px;
    width: 40px;
    object-fit: contain;
    max-width: initial;
}


.key-value-card-container {
    display: flex;
    flex-flow: row wrap;
    justify-content: left
}

.key-value-card {
    color: #1E1E1E;
    display: flex;
    width: fit-content;
    border-radius: 5px;
    margin: 0.375rem 0.625rem 0.375rem 0;
}

.key-value-card-inner {
    padding: 0.25rem 0.5rem;
    background: #F5A056;
}

.key-value-card-inner.left {
    border-radius: 5px 0 0 5px;
}

.key-value-card-inner.right {
    border-radius: 0 5px 5px 0;
}

.capitalize {
    font-weight: 400;
    text-transform: capitalize;
}

.key-value-card-separator {
    width: 0.125rem;
}

.queue-card {
    width: fit-content;
    border: 1px solid var(--card-border-color);
    border-radius: 8px;
    background: var(--card-background-color);
    padding: 0 10px 2px 10px;
    margin-bottom: 10px;
}

legend {
    font-family: Segoe UI, sans-serif;
    text-transform: capitalize;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 10px 10px 0;
}

.session-config-section {
    font-size: 16px;
    margin-bottom: 10px;
}

.queues-container {
}

.queue-checkbox-container {
    display: inline-block;
    margin-bottom: 10px;
    background: var(--card-background-color);
    outline: 1px solid var(--card-border-color);
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.queue-checkbox-container:not(:last-child) {
    margin-right: 10px;
}

.queue-checkbox-container.checked {
    outline: 2px solid #00A295;
}

.queue-checkbox-container label {
    cursor: pointer;
    font-family: Segoe UI, sans-serif;
    font-size: 14px;
    margin: 0;
}

.queue-checkbox-container.checked label {
    color: #00A295 !important;
}

.queue-checkbox {
    margin-left: 20px;
}

input.queue-checkbox {
    width: 20px;
    height: 20px;
}

.batch-filter-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    height: 49px;
    margin: 2rem 0;
}

.batch-filter-row > .filter-group {
    height: 100%;
    display: flex;
    align-items: center;
    border: 1px solid var(--dark-blue);
    border-radius: 5px;
    gap: 2rem;
    padding: 0 1rem;
}

table.fold-table > thead, tfoot {
    background-color: var(--table-header-background-color);
}

table.fold-table > tbody > tr.view td,
table.fold-table > tbody > tr.view th {
    cursor: pointer;
}

table.fold-table > tbody > tr.fold {
    display: none;
    background: none;
}

table.fold-table > tbody > tr.fold.open {
    display: table-row;
}

table.fold-table > tbody > tr.fold :not(thead, tfoot) > * > td {
    --font-size: 1.05em !important;
}

table.fold-table {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--dark-blue);
    border-radius: 5px;
    border-collapse: separate;
}

/* Truncate long batch names to keep the cell from bloating; full name on hover (title). */
.batch-name-cell {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/**
 * round corner for table seems to work only with border-collapse: separate
 * which caused td/th inside to have squared corner that overlap with the rounded corner of the table
 * we need to prevent this by setting a round corner for these cells
 * @todo : find a better way to do this ?
 */
table.fold-table > thead > tr > th:first-child {
    border-radius: 3px 0 0 0;
}

table.fold-table > thead > tr > th:last-child {
    border-radius: 0 3px 0 0;
}

/* only works this way since td is a colspan for the full row */
table.fold-table > tfoot > tr > td {
    border-radius: 0 0 3px 3px;
}

div.sub-elements-container > div > table.fold-table {
    border-radius: 0;
    width: fit-content;
    margin: 0 1.2rem 0 5.5rem;
    white-space: nowrap;
}

div.sub-elements-container > div > table.fold-table > thead > tr > th {
    font-size: 0.9rem;
}

div.sub-elements-container > div > table.fold-table > thead > tr > th,
div.sub-elements-container > div > table.fold-table > tbody > tr > td {
    padding-left: 1.25rem;
}

table.fold-table > thead > tr,
table.fold-table > tbody > tr,
table.fold-table > tfoot > tr
{
    height: 4rem;
}

/* Table scrolls inside its own box so the page itself doesn't scroll. */
/* Full-height "app" layout for the batch page: the PAGE itself never scrolls;
   only the table body does, so the sticky header + footer stay visible and there
   is exactly one scrollbar. No magic-number heights. Scoped to the batch page
   via :has (app targets Chromium). */
body:has(.batches-page) {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body:has(.batches-page) > .container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.batches-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.batches-page > .table-scroll {
    flex: 1 1 auto;
    min-height: 0;
}

/* The whole table scrolls inside this box; the header is kept fixed via sticky
   (below), so it stays visible without breaking the nested expand-row tables. */
.table-scroll {
    overflow: auto;
    border: 1px solid var(--dark-blue);
}

/* Keep the header pinned to the top of the scroll box (needs its own bg since
   th is transparent). Footer lives outside the box (see .table-footer-bar). */
.table-scroll > table.fold-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: var(--table-header-background-color);
}

/* Empty-state message centered in the table's default height. */
.batches-empty > td {
    height: 16rem;
    text-align: center;
    vertical-align: middle;
    cursor: default;
}

.empty-state {
    color: var(--muted-color, #6c757d);
    font-size: 1.1rem;
}

/* Footer bar lives OUTSIDE the scroll box; header is sticky inside it. */
.table-footer-bar {
    flex: 0 0 auto;
    padding: 0.75rem 2rem;
    background-color: var(--table-header-background-color);
    border: 1px solid var(--dark-blue);
    border-top: none;
    border-radius: 0 0 5px 5px;
    margin-bottom: 15px;
}

.table-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    font-weight: normal;
}

.footer-left,
.footer-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.footer-total,
.footer-page {
    white-space: nowrap;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    margin-bottom: 0;
}

.per-page-selector > select {
    width: auto;
    margin: 0;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-nav > .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid var(--secondary-focus);
    border-radius: 0.3125rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
}

.footer-nav > .page-btn:hover {
    background-color: var(--secondary-focus);
}

.footer-nav > .page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

/* Let the batch list use the full page width (Pico's .container has stepped
   max-widths that leave big side margins between breakpoints). Scoped to the
   batch page only via :has (app targets Chromium). */
.container:has(> .batches-page) {
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 0;
}

/* No trailing margin under the section, so the footer bar reaches the screen bottom. */
.batches-page {
    margin-bottom: 0;
}
.batches-page > *:last-child {
    margin-bottom: 0;
}

.batch-filter-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    align-content: stretch;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
    font-weight: bold;
}

@media screen and (max-width: 1280px) {
    .batch-filter-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

.secondary-text {
    color: var(--light-gray);
    font-size: 0.7rem;
}

.info-tooltip[data-tooltip] {
    display: inline-block;
    cursor: pointer;
    border: none;
}

.info-tooltip > img {
    height: 1rem;
    margin: 0 0 0.15rem 0.3rem;
}

.batch-filter-area {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-evenly;
    align-items: stretch;
    align-content: stretch;
    border: 1px solid var(--secondary-focus);
    border-radius: 0.3125rem;
    gap: 0.625rem;
    padding: 0.69rem 1.06rem;
    font-weight: normal;
    margin-right: 1rem;
}

.batch-filter {
    border-radius: 0.3125rem;
    padding: 0.3125rem 0.625rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.batch-filter.batch-filter-checked {
    color: #00A295;
    background-color: var(--secondary-focus);
    cursor: default;
}

.batch-filter:hover {
    background-color: var(--secondary-focus);
}

th a {
    text-decoration: none;
    color: inherit;
}

/* One compact line between the pills and the table; the page is a fixed
   100vh flex column, so any extra filter height is stolen from the table.
   Fields split the full row width evenly so content + clear × have room. */
.batch-filter-form {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex: 0 0 auto;
}

.batch-filter-form input,
.batch-filter-form select {
    width: 100%;
    min-width: 0;
    margin: 0;
    height: 2rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.7rem;
    color: var(--light-gray);
    white-space: nowrap;
    flex: 1 1 0;
    min-width: 0;
}

.filter-control {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.filter-clear {
    text-decoration: none;
    color: var(--light-gray);
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0 0.3rem;
}

.filter-clear:hover {
    color: #00A295;
}


div.md > * {
    color: inherit !important;
}

.assignment-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-evenly;
    align-items: center;
    align-content: stretch;
    text-align: center;
    background: var(--assignment-background-color);
    box-shadow: 0 4px 8px 4px rgba(0, 0, 0, 0.15);
    border-radius: 6.25rem;
    z-index: 50; /* above the sticky table header/footer (z-index 3) */
    position: fixed;
    bottom: 3rem;
    width: fit-content;
    height: fit-content;
    left: 50%;
    transform: translateX(-50%);
    gap: 0.94rem;
    padding: 1rem 2.69rem 0.94rem;
    margin: 0 auto;
}

.assignment-drop-down {
    width: 8rem;
    height: fit-content;
    border-radius: 0.3125rem;
    text-align-last: left;
    background: var(--assignment-background-color);
}

.assignment-button {
    padding: 0.3125rem 0.625rem;
    align-items: center;
    width: fit-content;
}

.assignment-element {
    margin: auto;
}

.toast-container {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    align-content: stretch;
    gap: 1rem;
    position: fixed;
    bottom: 0;
    width: fit-content;
    height: fit-content;
    left: 50%;
    transform: translateX(-50%);
    animation: toast-animation 4s;
    opacity: 0;
}

.toast {
    width: fit-content;
    height: fit-content;
    color: white;
    background-color: var(--primary);
    text-align: center;
    border-radius: 2rem;
    padding: 1rem 2.69rem 0.94rem;
    z-index: 2;
    animation-delay: 100ms;
    box-shadow: 0 4px 8px 4px rgba(0, 0, 0, 0.15);
}

.toast.error {
    background-color: var(--light-orange);
}

@keyframes toast-animation {
    from {
        opacity: 0;
    }
    10% {
        opacity: 1;
        bottom: 2rem;
    }
    90% {
        opacity: 1;
        bottom: 2rem;
    }
    to {
        opacity: 0;
    }
}