/* =========================================================
   Hộp thoại bootbox 4.4 (GO.confirm / GO.prompt trong zCommon.js) trên trang dùng Bootstrap 5.
   bootbox 4.4 sinh markup kiểu Bootstrap 3: nút đóng dùng lớp .close (Bootstrap 5 đã bỏ) và đứng
   TRƯỚC tiêu đề, nút Hủy của GO.confirm là btn-warning (màu vàng). Nạp tệp này sau bootbox.min.js ở mọi
   trang có hộp thoại bootbox (_Layout quản trị, trang công khai tự nạp bootbox).
   Màu chủ đạo theo từng giao diện: đặt biến trên .bootbox (vd. layout.css của trang quản trị):
     --bootbox-mau-chinh : màu viền focus/ô nhập, --bootbox-nen-chinh : nền nút btn-primary.
   ========================================================= */
.bootbox {
    --bootbox-mau-chinh: #4753bf;
    --bootbox-nen-chinh: linear-gradient(135deg, #4753bf 0%, #3a44a0 100%);
}

    /* Căn giữa theo chiều dọc; giữ bề rộng theo kích thước bootbox (size: 'large'... → modal-lg/xl) */
    .bootbox .modal-dialog {
        min-height: calc(100% - 3.5rem);
        display: flex;
        align-items: center;
    }

    /* Hộp xác nhận/thông báo ngắn (GO.confirm, bootbox.alert) gọn hơn mặc định 500px */
    .bootbox.bootbox-confirm .modal-dialog:not(.modal-lg):not(.modal-xl),
    .bootbox.bootbox-alert .modal-dialog:not(.modal-lg):not(.modal-xl) {
        max-width: 420px;
    }

.bootbox .modal-content {
    width: 100%;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.bootbox .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 0 20px;
    border-bottom: none;
}

.bootbox .modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1e293b;
}

/* Nút × : tự định dạng (không còn .close) và đưa sang phải tiêu đề */
.bootbox .bootbox-close-button {
    order: 2;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

    .bootbox .bootbox-close-button:hover,
    .bootbox .bootbox-close-button:focus-visible {
        background: #f1f5f9;
        color: #334155;
        outline: none;
    }

.bootbox .modal-body {
    padding: 8px 24px;
    color: #334155;
    line-height: 1.5;
}

/* Ô nhập của GO.prompt (textarea) */
.bootbox .bootbox-input {
    margin-top: 8px;
    border-radius: 10px;
    border-color: #cbd5e1;
}

    .bootbox .bootbox-input:focus {
        border-color: var(--bootbox-mau-chinh);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--bootbox-mau-chinh) 15%, transparent);
    }

.bootbox .modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 24px 20px;
    border-top: none;
}

    .bootbox .modal-footer .btn {
        flex: 1 1 auto; /* nhiều nút (bootbox.dialog) thì tự xuống dòng thay vì bị bóp */
        margin: 0;
        padding: 10px 16px;
        border-radius: 10px;
        font-size: 0.9rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

        .bootbox .modal-footer .btn:focus-visible {
            outline: 2px solid var(--bootbox-mau-chinh);
            outline-offset: 2px;
            box-shadow: none;
        }

    /* Hủy của GO.confirm: nút phụ trung tính thay cho btn-warning màu vàng */
    .bootbox.bootbox-confirm .modal-footer .btn-warning {
        background: #fff;
        border: 1px solid #cbd5e1;
        color: #475569;
    }

        .bootbox.bootbox-confirm .modal-footer .btn-warning:hover {
            background: #f1f5f9;
            border-color: #94a3b8;
            color: #1e293b;
        }

    .bootbox .modal-footer .btn-primary {
        background: var(--bootbox-nen-chinh);
        border: none;
        color: #fff;
    }

        .bootbox .modal-footer .btn-primary:hover {
            filter: brightness(1.08);
        }

@media (max-width: 575.98px) {
    .bootbox .modal-dialog {
        margin: 1rem 16px;
        min-height: calc(100% - 2rem);
    }
}
