/*
 * Shared modal base classes for Paper Assistant.
 *
 * The error dialog (overlays.css), quality-regenerate confirmation
 * (overlays.css), and demo paper picker (demo.css) all share the same
 * backdrop / centred box / header / actions / button shell. These base
 * `.modal*` classes carry the common structure; each modal keeps its own
 * BEM classes for the parts that genuinely differ (header colour, box
 * sizing, button variants).
 *
 * Loaded before overlays.css and demo.css so the modal-specific rules can
 * layer additional properties on top.
 */

/* Full-screen positioning context; toggled via inline display:none. */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.modal__box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--toolbar-bg, #ffffff);
    border: 1px solid var(--toolbar-sep-color, #ddd);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* Header background colour is set per-modal (error red vs. accent blue). */
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
}

.modal__close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal__close:hover {
    opacity: 0.8;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--toolbar-sep-color, #ddd);
}

.modal__btn {
    padding: 6px 16px;
    border: 1px solid var(--toolbar-sep-color, #ddd);
    border-radius: 4px;
    background: var(--toolbar-bg, #ffffff);
    color: var(--toolbar-fg, #333);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.modal__btn:hover {
    background: var(--toolbar-btn-active, #f0f0f0);
}
