/**
 * Multizone Admin — unified modal styling (AdminLTE + Bootstrap 4)
 * Loaded after AdminLTE. Modals with .modal-content.bg-black / .bg-dark keep a minimal theme.
 */

.modal-backdrop.show {
    opacity: 0.55;
}

.modal.fade .modal-dialog {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

/* Shell */
.modal .modal-content:not(.bg-black):not(.bg-dark) {
    border: none;
    border-radius: 16px;
    box-shadow:
        0 25px 60px rgba(15, 23, 42, 0.22),
        0 0 0 1px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.modal .modal-content.bg-black,
.modal .modal-content.bg-dark {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

.modal .modal-content.bg-black::before,
.modal .modal-content.bg-dark::before {
    display: none;
}

/* Accent strip */
.modal .modal-content:not(.bg-black):not(.bg-dark)::before {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(90deg, #e11d2e 0%, #ef4444 50%, #f87171 100%);
}

/* Header — default (light) */
.modal .modal-header:not(.modal-header--inverse):not(.border-0) {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

.modal .modal-header.border-0 {
    background: #fff;
    border-bottom: none;
}

.modal .modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.modal .modal-title i {
    margin-right: 0.45rem;
    color: #3b82f6;
    opacity: 0.92;
}

.modal .modal-header .close {
    padding: 0.4rem 0.55rem;
    margin: -0.35rem -0.45rem -0.35rem auto;
    opacity: 0.55;
    border-radius: 10px;
    transition: background 0.15s ease, opacity 0.15s ease, color 0.15s ease;
    font-size: 1.35rem;
    line-height: 1;
}

.modal .modal-header .close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

/* Inverse header (e.g. profile / branded dialogs) */
.modal .modal-header.modal-header--inverse {
    background: linear-gradient(135deg, #0f2747 0%, #1a3a5c 100%);
    color: #fff;
    border-bottom: none;
    padding: 1rem 1.25rem;
}

.modal .modal-header.modal-header--inverse .modal-title {
    color: #fff;
}

.modal .modal-header.modal-header--inverse .modal-title i {
    color: #fbbf24;
    opacity: 1;
}

.modal .modal-header.modal-header--inverse .close {
    color: #fff;
    opacity: 0.85;
    text-shadow: none;
}

.modal .modal-header.modal-header--inverse .close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Body */
.modal .modal-body {
    padding: 1.25rem 1.25rem;
}

.modal .modal-body.p-0 {
    padding: 0 !important;
}

.modal .modal-body.py-0 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Footer */
.modal .modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 0.85rem 1.25rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal .modal-footer.border-0 {
    background: transparent;
    border-top: none !important;
}

.modal .modal-footer .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.45rem 1.15rem;
    min-height: 2.25rem;
}

.modal .modal-footer .btn-primary {
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.modal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.modal .modal-footer .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #475569;
    background: #fff;
}

.modal .modal-footer .btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Compact transactional modals (add / redeem points, quick forms) */
.modal.points-txn-modal .modal-dialog {
    max-width: 460px;
}

.modal.points-txn-modal .modal-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e8ecf1 !important;
}

.modal.points-txn-modal .modal-header .modal-title {
    font-size: 1.05rem;
}

.modal.points-txn-modal .modal-sub {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.35rem;
    line-height: 1.35;
}

.modal.points-txn-modal .modal-body {
    padding-top: 1rem;
}

.modal.points-txn-modal .material-radio {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem !important;
}

.modal.points-txn-modal .modal-footer {
    justify-content: flex-end;
}

.modal.points-txn-modal .modal-footer .btn-link {
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.5rem 1rem !important;
}

.modal.points-txn-modal .modal-footer .btn-link:hover {
    background: rgba(15, 23, 42, 0.06);
}

.modal.points-txn-modal .modal-footer .btn-redeem-confirm {
    border: none;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #0e7490 0%, #0f766e 100%);
    box-shadow: 0 4px 14px rgba(14, 116, 144, 0.4);
}

.modal.points-txn-modal .modal-footer .btn-redeem-confirm:hover {
    color: #fff;
    background: linear-gradient(135deg, #155e75 0%, #115e59 100%);
    box-shadow: 0 6px 18px rgba(14, 116, 144, 0.45);
}

/* custom-modal helper (package_theme, meal_plan, etc.) */
.modal .modal-content.custom-modal .modal-header.border-0 {
    border-bottom: 2px solid #e0e7ff !important;
    padding-bottom: 0.75rem;
}

.modal .modal-content.custom-modal .modal-title {
    color: #312e81;
}
