/*
 * bc-modal.css — BookingCenter Reusable Modal
 *
 * Designed to match the existing MyPMS UI (bc.css color palette, button styles).
 * HTML structure intentionally mirrors Bootstrap 5 modal markup for easy future migration:
 *
 *   Bootstrap 5 migration map:
 *   .bc-modal              → .modal
 *   .bc-modal-dialog       → .modal-dialog
 *   .bc-modal-content      → .modal-content
 *   .bc-modal-header       → .modal-header
 *   .bc-modal-title        → .modal-title
 *   .bc-modal-body         → .modal-body
 *   .bc-modal-footer       → .modal-footer
 *   .bc-modal-close        → .btn-close
 *   [data-bc-dismiss]      → [data-bs-dismiss="modal"]
 *
 * When migrating: swap class names above, remove this CSS file,
 * add Bootstrap 5, and replace BCModal.open()/close() calls with
 * bootstrap.Modal instances.
 */

/* ─── Overlay ────────────────────────────────────────────────────────────── */

.bc-modal {
    display: none;
    position: fixed;
    z-index: 9050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.45);
    /* Flex centering — same result as Bootstrap's approach */
    -webkit-box-align: start;
    align-items: flex-start;
}

.bc-modal.is-open {
    display: block;
}

/* ─── Dialog ─────────────────────────────────────────────────────────────── */

.bc-modal-dialog {
    position: relative;
    width: auto;
    margin: 60px auto 30px;
    max-width: 560px;
    pointer-events: none;
}

/* Size variants */
.bc-modal-dialog.bc-modal-sm  { max-width: 380px; }
.bc-modal-dialog.bc-modal-lg  { max-width: 780px; }  /* matches .fwbox width */
.bc-modal-dialog.bc-modal-xl  { max-width: 1024px; } /* matches .fwboxwide */

/* ─── Content shell ──────────────────────────────────────────────────────── */

.bc-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    background-color: #ffffff;
    border: 1px solid #888888;
    border-radius: 3px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.35);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9pt;
    color: #000000;
    outline: 0;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.bc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background-color: #2c80b7;  /* matches .btn_flat_blue / primary blue */
    border-bottom: 1px solid #22638e;
    border-radius: 2px 2px 0 0;
    min-height: 26px;            /* matches .box .box_header height */
}

/* Danger variant header */
.bc-modal-danger .bc-modal-header {
    background-color: #920000;
    border-bottom-color: #6a0000;
}

/* Warning variant header */
.bc-modal-warning .bc-modal-header {
    background-color: #ee8426;
    border-bottom-color: #c46b18;
}

/* Neutral/gray variant header */
.bc-modal-gray .bc-modal-header {
    background-color: #596259;
    border-bottom-color: #3d453d;
}

.bc-modal-title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
    line-height: 26px;
    padding: 0;
}

/* ─── Close button ───────────────────────────────────────────────────────── */

.bc-modal-close {
    background: transparent;
    border: none;
    padding: 0 0 0 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    opacity: 0.85;
    box-shadow: none;
    /* Override button.css global [type="button"] styles */
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.bc-modal-close:hover,
.bc-modal-close:focus {
    opacity: 1;
    color: #ffffff;
    outline: none;
}

/* ─── Body ───────────────────────────────────────────────────────────────── */

.bc-modal-body {
    padding: 16px 20px;
    flex: 1 1 auto;
    background-color: #ffffff;
    line-height: 1.5;
}

/* Optional scrollable body for tall content */
.bc-modal-body-scroll {
    overflow-y: auto;
    max-height: 400px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.bc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    background-color: #f4f4f4;
    border-top: 1px solid #cccccc;
    border-radius: 0 0 2px 2px;
}

/* Left-aligned footer variant */
.bc-modal-footer.bc-footer-left {
    justify-content: flex-start;
}

/* Space-between footer variant */
.bc-modal-footer.bc-footer-split {
    justify-content: space-between;
}

/* ─── Loading state ──────────────────────────────────────────────────────── */

.bc-modal-loading {
    text-align: center;
    padding: 24px 0 8px;
    color: #555555;
    font-style: italic;
}

/* ─── Form layout helpers (for modals with inline forms) ─────────────────── */

.bc-modal-body .bc-form-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 8px;
}

.bc-modal-body .bc-form-row label {
    min-width: 120px;
    font-weight: bold;
    font-size: 9pt;
    flex-shrink: 0;
}

.bc-modal-body .bc-form-row input,
.bc-modal-body .bc-form-row select,
.bc-modal-body .bc-form-row textarea {
    flex: 1;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9pt;
    color: #000000;
    padding: 3px 5px;
    border: 1px solid #aaaaaa;
    border-radius: 2px;
}

.bc-modal-body .bc-form-row textarea {
    resize: vertical;
    min-height: 60px;
}

/* ─── Inline message area (for validation/status feedback) ───────────────── */

.bc-modal-msg {
    display: none;
    margin: 0 20px 12px;
    padding: 6px 10px;
    border-radius: 2px;
    font-size: 9pt;
    font-weight: bold;
}

.bc-modal-msg.bc-msg-error {
    display: block;
    background-color: #FF9999;
    border: 1px solid #990000;
    color: #990000;
}

.bc-modal-msg.bc-msg-success {
    display: block;
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.bc-modal-msg.bc-msg-info {
    display: block;
    background-color: #e6f2ff;
    border: 1px solid #005081;
    color: #005081;
}
