/* ==========================================================
   Dialog Overlay
========================================================== */

.dialog {

    position: fixed;

    inset: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    background: rgba(0,0,0,.25);

    z-index: 9000;

}

.dialog.hidden {

    display: none;

}

/* ==========================================================
   Dialog Window
========================================================== */

.dialogContent {

    width: 420px;
	
	padding: 20px;

    background: white;

    border-radius: 10px;

    box-shadow: 0 12px 32px rgba(0,0,0,.25);

    overflow: hidden;

}

/* ==========================================================
   Header
========================================================== */

.dialogHeader {

    padding: 14px 18px;

    font-weight: 600;

    border-bottom: 1px solid var(--color-border);

}

/* ==========================================================
   Body
========================================================== */

.dialogBody {

    min-height: 220px;

    padding: 16px;

}

/* ==========================================================
   Footer
========================================================== */

.dialogFooter {

    display: flex;

    justify-content: flex-end;

    gap: 10px;

    padding: 14px 18px;

    border-top: 1px solid var(--color-border);

}

/* OLD
.datasetItem {

    display: block;

    padding: 4px 0;

}
*/ 

.datasetItem {
    display: flex;
    align-items: center;
}

.datasetName {
    flex: 1;
}

.datasetConfigure {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}

.selectionItem {
    display: block;
    margin-bottom: 6px;
}

.selectionList {
    min-height: 180px;
    max-height: 180px;
    overflow-y: auto;
}

.dialogHeader {

    padding: 14px 18px;

    border-bottom: 1px solid var(--color-border);
}

#walkDatasetSelectionTitle {

    font-size: 1.3rem;
    font-weight: 600;

}

#walkDatasetSelectionCounts {

    margin-top: 4px;

    font-size: 0.9rem;

    color: var(--color-text-secondary);   /* of var(--color-secondary-text), afhankelijk van je thema */
}

#gpxImportProgress {
    margin-top: 20px;
}

#gpxImportProgressBar {
    width: 100%;
}

#gpxImportProgressText {
    margin-bottom: 8px;
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================
   Dialogs fit the screen (UI-NAV-02): never wider or higher
   than the window; header and buttons stay visible, the body
   scrolls
========================================================== */

.dialogContent {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.dialogHeader,
.dialogFooter {
    flex: 0 0 auto;
}

.dialogBody {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 700px) {

    .dialogContent {
        padding: 8px;
    }

    .dialogBody {
        min-height: 0;
        padding: 10px 8px;
    }

    /* the selection lists share the height of the screen */
    .selectionList {
        min-height: 0;
        max-height: 30vh;
    }
}

/* ===== Traject search (UI-SEARCH-01) ===== */

.searchForm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.searchForm input[type="number"] {
    width: 5em;
}

.searchSource {
    display: inline-flex;
    gap: 10px;
}

.searchHint {
    margin: 8px 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary, #666);
}

.searchTable td.searchWalk {
    white-space: normal;
    min-width: 140px;
}

.searchWalk small {
    display: block;
    color: var(--color-text-secondary, #666);
}

.searchActions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* ===== Uploading in the import dialog (UI-IMPORT-01) ===== */

.importDrop {
    margin-top: 8px;
    padding: 10px;
    border: 2px dashed var(--color-border, #cbd5e1);
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary, #666);
}

.importDrop.dragover {
    border-color: var(--color-primary);
    background: rgba(46, 107, 69, .06);
}

.importUploadButtons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.importUploadInfo {
    margin-top: 6px;
    color: var(--color-text, #222);
}

.importUploadInfo button {
    margin-left: 6px;
}

.importMode {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 8px;
    font-size: 0.85rem;
}

/* own walks per dataset (UI-OWN-02) */
.datasetOwn {
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 10px;
    background: transparent;
    padding: 0 8px;
    margin-right: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.datasetOwn.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

/* ===== Import summary (UI-IMPORT-07) ===== */

.summaryTotal,
.summaryLine {
    margin: 4px 0;
}

.summaryGroup {
    margin: 4px 0;
}

.summaryGroup summary {
    cursor: pointer;
}

.summaryGroup ul {
    margin: 4px 0 8px;
    padding-left: 1.4em;
    max-height: 30vh;
    overflow-y: auto;
}

.summaryGroup small {
    color: var(--color-text-secondary, #666);
}

/* Data · Wandelkwaliteit (UI-QUAL-01) */
.qualityWalk {
    cursor: pointer;
}

.qualityWalk:hover {
    text-decoration: underline;
}

.qualityWalk.current {
    font-weight: 600;
}

.qualityDataset {
    color: var(--color-text-secondary, #666);
}

.qualityDatasets {
    margin: 6px 0 10px;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.qualityDatasets th,
.qualityDatasets td {
    padding: 2px 10px 2px 0;
    text-align: left;
}

.qualityScore {
    display: inline-block;
    min-width: 2.2em;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* the quality overview stays open beside the list and Details: a panel
   over the map without the grey layer (UI-QUAL-01) */
#walkQualityDialog {
    background: transparent;
    pointer-events: none;
    justify-content: flex-start;
    align-items: flex-start;
}

#walkQualityDialog .dialogContent {
    pointer-events: auto;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 110px);
    margin: 90px 0 0 16px;
    display: flex;
    flex-direction: column;
}

#walkQualityDialog .dialogBody {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}
