/* Modal Design System Improvements */
/* Uses ONLY existing design tokens from redesign-style.css */

/* A. Modal Container */
.modal-content {
    border-radius: 15px; /* Match header-inner */
    border: 1px solid #EBEBEB; /* Existing border color */
    box-shadow: 0 8px 32px rgba(26, 25, 25, 0.25) !important; /* Strong shadow since no backdrop */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    background: #ffffff !important;
    opacity: 1 !important;
}

.modal-dialog {
    max-width: 600px; /* Intentional, not too wide */
    background-color: transparent !important; /* Remove white background from dialog container */
    background: transparent !important;
    padding: 0 !important; /* Remove padding that creates white space */
}

/* Remove white background from modal container itself */
.modal {
    background-color: transparent !important;
    background: transparent !important;
}


.modal-dialog.modal-lg {
    max-width: 800px; /* Keep larger modals appropriately sized */
}

/* B. Modal Header */
.modal-header {
    padding: 24px 24px 20px; /* Improved spacing */
    border-bottom: 1px solid #EBEBEB; /* Existing border color */
    border-radius: 15px 15px 0 0; /* Match modal-content */
}

.modal-title {
    font-weight: 700; /* Match button font-weight */
    font-size: 20px; /* Slightly larger, professional */
    line-height: 24px;
    color: #1A1919; /* Primary text color */
    margin: 0; /* Remove default margin */
}

.modal-header h1.modal-title,
.modal-header h2.modal-title,
.modal-header h3.modal-title,
.modal-header h4.modal-title,
.modal-header h5.modal-title {
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: #1A1919;
}

/* E. Close Button */
.modal-header .close {
    opacity: 1;
    color: #767676; /* Secondary text color */
    font-size: 24px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.modal-header .close:hover,
.modal-header .close:focus {
    color: #1A1919; /* Primary text on hover */
    opacity: 1;
}

/* C. Modal Body */
.modal-body {
    padding: 24px; /* Improved spacing (match form-group margin-bottom) */
    color: #1A1919; /* Primary text */
}

.modal-body p {
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #1A1919;
    margin-bottom: 16px; /* Better vertical rhythm */
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body .text-muted,
.modal-body small,
.modal-body .form-text.text-muted {
    font-weight: 500;
    font-size: 14px;
    line-height: 18px;
    color: #767676; /* Secondary text color */
}

.modal-body h6 {
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    color: #1A1919;
    margin-bottom: 12px;
}

.modal-body ul,
.modal-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.modal-body ul li,
.modal-body ol li {
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #1A1919;
    margin-bottom: 8px;
}

/* Alert components in modals - maintain spacing */
.modal-body .alert {
    margin-bottom: 24px;
}

.modal-body .alert:last-child {
    margin-bottom: 0;
}

/* D. Modal Footer */
.modal-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid #EBEBEB;
    border-radius: 0 0 15px 15px;
    gap: 12px; /* Space between buttons */
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.modal-footer .btns {
    margin: 0; /* Remove any default margins */
}

/* Ensure proper spacing when buttons are in flex container */
.modal-footer .btns + .btns {
    margin-left: 12px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 16px;
        max-width: calc(100% - 32px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .modal-header {
        padding-top: 20px;
        padding-bottom: 16px;
    }

    .modal-footer {
        padding-top: 16px;
        padding-bottom: 20px;
        flex-direction: column-reverse; /* Stack buttons on mobile */
    }

    .modal-footer .btns {
        width: 100%;
    }

    .modal-footer .btns + .btns {
        margin-left: 0;
        margin-bottom: 12px;
    }
}

