/*
 * pcu-planning-handoff-dialog — the confirmation behind "Im Fortbildungsplaner verfeinern".
 *
 * HUMAN-OWNED, same rules as `PcuPlanningRunDialog.css`: only `--uui-*`, layout only. The
 * surface, header and scrim come from `uui-modal-overlay` / `uui-modal`, the notices from
 * `uui-alert`, the buttons from `uui-button`. What is left here is the course list and its
 * outcome pill, the one thing drawn locally for the same reason as the run dialog's step state:
 * there is no published component for it, and it exists in exactly one dialog.
 *
 * Folder: logged-in users — nothing anonymous plans Fortbildungen.
 */

pcu-planning-handoff-dialog {
    display: contents;
}

/* Own modal host → own stacking; see the run dialog for why `auto` was not enough. */
pcu-planning-handoff-dialog .uui-modal-overlay__root,
pcu-planning-handoff-dialog .uui-modal-overlay__stage {
    z-index: 10;
}

pcu-planning-handoff-dialog .uui-modal__body {
    min-inline-size: 0;
}

.pcu-planning-handoff-dialog__content,
.pcu-planning-handoff-dialog__body {
    box-sizing: border-box;
    min-inline-size: 0;
    display: grid;
    /* `minmax(0, 1fr)`: an auto track never shrinks below `uui-alert`'s min-content. */
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
}

.pcu-planning-handoff-dialog__content {
    padding-block: 0 var(--uui-spacing-6);
    gap: var(--uui-spacing-5);
}

.pcu-planning-handoff-dialog__body {
    gap: var(--uui-spacing-4);
}

.pcu-planning-handoff-dialog__body p {
    margin: 0;
}

/* --------------------------------------------------------------- Warnings */

.pcu-planning-handoff-dialog__warnings {
    margin: 0;
    padding-inline-start: var(--uui-spacing-5);
    display: grid;
    gap: var(--uui-spacing-1);
    color: var(--uui-text-secondary);
}

/* ---------------------------------------------------------------- Courses */

.pcu-planning-handoff-dialog__courses {
    display: grid;
    gap: var(--uui-spacing-2);
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    padding: 0;
    list-style: none;
    /* The list can grow without bound; the notice and the actions must stay reachable. */
    max-block-size: min(46vh, 32rem);
    overflow-y: auto;
}

.pcu-planning-handoff-dialog__course {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--uui-spacing-3);
    align-items: start;
}

.pcu-planning-handoff-dialog__course-body {
    display: grid;
    gap: var(--uui-spacing-0-5);
    min-inline-size: 0;
}

.pcu-planning-handoff-dialog__outcome {
    inline-size: 9.5rem;
    padding: var(--uui-spacing-0-5) var(--uui-spacing-2);
    border-radius: var(--uui-radius-full);
    font-size: var(--uui-text-xs-font-size);
    line-height: var(--uui-text-xs-line-height);
    text-align: center;
    background: var(--uui-bg-secondary);
    color: var(--uui-text-secondary);
}

.pcu-planning-handoff-dialog__course[data-outcome="reuse"] .pcu-planning-handoff-dialog__outcome {
    background: var(--uui-color-brand-100);
    color: var(--uui-color-brand-700);
}

.pcu-planning-handoff-dialog__course[data-outcome="create"] .pcu-planning-handoff-dialog__outcome {
    background: var(--uui-color-green-100);
    color: var(--uui-color-green-700);
}

/* Split and unreachable are "new" too, but new because the wizard cannot take the plan over. */
.pcu-planning-handoff-dialog__course[data-outcome="split"] .pcu-planning-handoff-dialog__outcome,
.pcu-planning-handoff-dialog__course[data-outcome="unreachable"] .pcu-planning-handoff-dialog__outcome {
    background: var(--uui-bg-warning-secondary);
    color: var(--uui-text-warning-primary);
}

/* ---------------------------------------------------------------- Actions */

.pcu-planning-handoff-dialog__actions {
    display: flex;
    gap: var(--uui-spacing-3);
    justify-content: flex-end;
    /* Same distance as `uui-modal-actions`: 32px, divider, 24px, minus the grid's own gap. */
    margin-block-start: calc(var(--uui-spacing-4xl) + 1px + var(--uui-spacing-3xl) - var(--uui-spacing-5));
}
