/* ========================================================
   GLOBAL TEMPORARY POPUP MODAL (System Alerts & Errors)
   ======================================================== */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(15 23 42 / 60%); /* Translucent dark backdrop */
    backdrop-filter: blur(4px);              /* Modern glass distortion */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;                           /* Ensures it sits on top of all UI layers */
    padding: calc(var(--ui-scale) * 1);
    box-sizing: border-box;
}

.modal-surface {
    background-color: #fff;
    width: 100%;
    max-width: calc(var(--ui-scale) * 28);
    border-radius: calc(var(--ui-scale) * 0.5);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 10%), 0 10px 10px -5px rgb(0 0 0 / 4%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-slide-up .5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--ui-scale) * 1) calc(var(--ui-scale) * 1.25);
    border-bottom: 1px solid #e2e8f0;
}

.modal-title-text {
    font-size: calc(var(--ui-scale) * 1.15);
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Eye-catching color modifier specifically for Error dialog headers */
.modal-overlay.has-error .modal-title-text {
    color: #dc2626; /* Crimson alert tone */
}

.modal-close-icon {
    background: none;
    border: none;
    font-size: calc(var(--ui-scale) * 1.75);
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    transition: color 0.1s ease;
}

.modal-close-icon:hover {
    color: #475569;
}

.modal-body-text {
    padding: calc(var(--ui-scale) * 1.25);
    font-size: calc(var(--ui-scale) * 0.95);
    line-height: 1.5;
    color: #334155;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-actions-row {
    padding: calc(var(--ui-scale) * 0.75) calc(var(--ui-scale) * 1.25);
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.modal-ack-btn {
    min-width: calc(var(--ui-scale) * 6);
    flex: none; /* Prevents button stretching */
}

/* Modal Entrance Animation */
@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(0%, 0%);
    }
}
