/* Filter container */
.filter-container {
    margin-bottom: 1.5em;
    display: flex;
    justify-content: start;
    gap: 1em;
    flex-wrap: wrap;
    font-size: 13px;
}

.filter-label {
    font-weight: bold;
}

.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* Dropdown button */
#areaDropdownBtn {
    padding: 0.5em 2em 0.5em 1em;
    cursor: pointer;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    position: relative;
    min-width: 15ch;
    text-align: left;
}

.dropdown-arrow {
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
}

/* Dropdown panel */
#areaDropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.25em;
}

.dropdown-inner {
    padding: 0.5em;
}

.select-all-wrapper {
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee;
}

.select-all-label {
    display: block;
    cursor: pointer;
    padding: 0.5em;
    border-radius: 3px;
    font-size: 0.9em;
    color: #666;
    transition: background-color 0.2s;
}

.select-all-label input {
    margin-right: 0.5em;
    cursor: pointer;
}

/* Clear button */
#clearFilter {
    width: fit-content;
    padding: 0.5em 1em;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Training table */
#trainingTable {
    width: 100%;
}

#trainingTable td:not(:first-child):not(:last-child) {
    padding-left: 0;
    padding-right: 0;
}

/* Checkbox labels */
.checkbox-label {
    display: block;
    cursor: pointer;
    padding: 0.5em;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.checkbox-label:hover {
    background-color: #f0f0f0;
}

.checkbox-label.checked {
    background-color: #e3f2fd;
    font-weight: 500;
}

.checkbox-label input {
    margin-right: 0.5em;
    cursor: pointer;
}

/* Table footer */
.no-sort-note {
    text-align: center;
}

/* DataTables override */
.dt-length {
    display: flex;
    align-items: center;
    gap: 1em;
}

div.dtr-modal-content {
    padding: 2em !important;
}

div.dtr-modal-content table.dtr-details td {
    vertical-align: top;
}

div.dtr-modal-content table.dtr-details td:first-child {
    padding-right: 1em;
    font-weight: bold;
}

div.dtr-modal-content h2 {
    font-size: 1.25em;
}

td.dtr-control::before {
    display: none !important;
}

table.dataTable th div.dt-column-header {
    flex-direction: row !important;
}

/* Keep DataTables length + search controls on one line on mobile */
@media (max-width: 767px) {
    div.dt-container div.dt-layout-row:first-child {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    div.dt-container div.dt-layout-row:first-child div.dt-layout-cell {
        display: flex;
        text-align: initial;
    }

    div.dt-container div.dt-layout-row:first-child div.dt-layout-start {
        margin-right: auto;
    }

    div.dt-container div.dt-layout-row:first-child div.dt-layout-end {
        margin-left: auto;
    }
}

@media (max-width: 445px) {
    .filter-container {
        justify-content: space-between;
        align-content: start;
    }
}