/**
 * Modal Standardization
 * Ensures all modals have consistent sizing across the application
 */

/* Standard Modal Size - 900px width */
.modal-lg,
.modal-dialog.modal-lg {
    max-width: 900px !important;
    width: 900px !important;
    margin: 1.75rem auto !important;
}

/* Modal Content Standardization */
.modal-lg .modal-content {
    max-height: 85vh !important;
    min-height: 600px;
    border-radius: 12px;
}

/* Scrollable Modal Body */
.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    max-height: calc(85vh - 120px);
}

/* Z-Index Hierarchy */
.modal {
    z-index: 10050 !important;
}

.modal-backdrop {
    z-index: 10049 !important;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .modal-lg,
    .modal-dialog.modal-lg {
        max-width: 95vw !important;
        width: 95vw !important;
        margin: 1rem auto !important;
    }

    .modal-lg .modal-content {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .modal-lg,
    .modal-dialog.modal-lg {
        max-width: 95vw !important;
        width: 95vw !important;
        margin: 0.5rem auto !important;
    }

    .modal-lg .modal-content {
        max-height: 90vh !important;
        min-height: 500px;
    }
}

@media (max-width: 576px) {
    .modal-lg,
    .modal-dialog.modal-lg {
        margin: 0.5rem !important;
    }

    .modal-lg .modal-content {
        min-height: 500px !important;
    }
}

/* Modal Header Consistency */
.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
}

/* Modal Footer Consistency */
.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

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

/* Ensure modals are always on top of other content */
.modal.show {
    display: flex !important;
    align-items: center;
}

/* Fix for modal centering */
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

@media (max-width: 576px) {
    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }
}
