/**
 * Modal-Dialog Widget (Base)
 * Farben aus colors.css, keine ID-Selektoren (011-ui-css-general.mdc).
 */

.base-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.base-modal-overlay.base-modal-open {
    display: flex;
}

.base-modal-dialog {
    background: var(--color-surface);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 100%;
    width: 32rem;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.base-modal-dialog-form-stack {
    background: var(--color-surface);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 100%;
    width: 40rem;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.base-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.base-modal-title {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: 0;
}

.base-modal-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.base-modal-close:hover {
    color: var(--color-text);
}

.base-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.base-modal-stack-divider {
    margin-top: 1.75rem;
    margin-bottom: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.base-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .base-modal-dialog {
        width: 100%;
        max-height: 90vh;
    }

    .base-modal-dialog-form-stack {
        width: 100%;
        max-height: 90vh;
    }
}
