﻿.attachemnts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Only take vertical space once there is something to show. */
.attachemnts:has(> *) {
    margin-top: 0.75rem;
}

.attachment-chip {
    flex: 0 0 auto;
    max-width: 15rem;
    min-width: 0;
    gap: 0.5rem;
    padding: 0.375rem 0.25rem 0.375rem 0.625rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.attachment-chip:hover {
    border-color: #adb5bd;
    background-color: #f1f3f5;
}

.attachment-chip-icon {
    flex: 0 0 auto;
    font-size: 1.35rem;
    line-height: 1;
    color: #6c757d;
}

.attachment-chip-body {
    min-width: 0;
    line-height: 1.2;
}

.attachment-chip-name {
    font-size: 0.8125rem;
    font-weight: 500;
}

.attachment-chip-remove {
    flex: 0 0 auto;
    color: #adb5bd;
}

.attachment-chip-remove:hover {
    color: #dc3545;
}

.tinymce-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding-top: 0.5rem;
}

.tinymce-wrapper .tox-tinymce {
    flex: 1 1 0 !important;
    height: auto !important;
}

/* body errors: red outline like the DX editors, icon in the free end of the toolbar */
.tinymce-wrapper.invalid .tox-tinymce {
    border-color: var(--bs-danger);
}

.tinymce-wrapper > .validation-icon {
    position: absolute;
    top: 1.15rem;
    right: 0.75rem;
    z-index: 2;
}
/* ── Audience dialog ── */

/* The popup body is bounded (fixed popup height) so the crew grid scrolls instead of
   growing the popup with every row it loads. */
.audience-popup-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden !important;
}

.audience-dialog {
    display: flex;
    gap: 1rem;
    flex: 1 1 0;
    min-height: 0;
}

/* Fixed width: narrower and the tabs scroll and the tree commands wrap. */
.audience-filter {
    flex: 0 0 380px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

/* the filter's EditForm sits between the column and its body/footer */
.audience-filter-form {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.audience-filter-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem;
}

.audience-filter-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #dee2e6;
}

.audience-list {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.audience-section-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
}

/* checkbox tree used for ships, positions, reasons, agencies and nationalities */
.tree-select-box {
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    padding: 0.25rem;
    position: relative;
}

/* each audience source option reads as a selectable row, radio centred on its text */
.audience-picker.dxbl-radio-group > .dxbl-checkbox.dxbl-checkbox-radio {
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: pointer;
}

.audience-picker.dxbl-radio-group > .dxbl-checkbox.dxbl-checkbox-radio.dxbl-checkbox-checked {
    border-color: var(--dxds-color-border-primary-default-rest, #0f6cbd);
    background-color: var(--dxds-color-surface-primary-subdued-rest, #ebf3fc);
}

/* Crew field placeholders outside the editor (e.g. the Preview dialog renders the editor HTML);
   inside the editor iframe the same rules come from wwwroot/css/tinymce-content.css. */
span.tinymce-crew-field {
    color: #009ef7;
    font-style: italic;
}

span.tinymce-crew-field::before {
    content: attr(data-field);
}
