/*
 * Global modal appearance.
 *
 * Visual styling only — no size changes. Each modal keeps whatever width /
 * height it was configured with (modal-sm/md/lg/xl, custom max-width, etc.).
 * This file just unifies the look: rounded corners, a tidy header with a
 * circular X close button, comfortable body padding, and a clean footer.
 */

.modal-content {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: left;
}

.modal-header {
    align-items: center;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid rgba(127, 127, 127, 0.18);
    gap: 0.75rem;
}

.modal-header .modal-title {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0;
    line-height: 1.2;
}

/*
 * Circular X close button. Works for both flavors used in the codebase:
 *  - <button class="close">…</button> (Bootstrap default)
 *  - <button class="modal-close-btn">…</button> (custom)
 * Inner text/markup (e.g. <small>Close</small>) is hidden and replaced with a
 * neat × glyph. If a child <i class="fa…"> icon is present, that renders
 * instead of the glyph.
 */
.modal-header .close,
.modal-header .modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    margin: 0 0 0 auto;
    border-radius: 999px;
    background: transparent;
    border: 1px solid rgba(127, 127, 127, 0.32);
    color: inherit;
    line-height: 1;
    font-size: 0;
    text-shadow: none;
    opacity: 1;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    cursor: pointer;
}

.modal-header .close:hover,
.modal-header .close:focus,
.modal-header .modal-close-btn:hover,
.modal-header .modal-close-btn:focus {
    background: rgba(127, 127, 127, 0.12);
    border-color: rgba(127, 127, 127, 0.55);
    text-decoration: none;
    outline: none;
    opacity: 1;
}

.modal-header .close:active,
.modal-header .modal-close-btn:active {
    transform: scale(0.95);
}

.modal-header .close > *,
.modal-header .modal-close-btn > * {
    font-size: 0.95rem;
    line-height: 1;
}

.modal-header .close > small {
    display: none;
}

.modal-header .close::before,
.modal-header .modal-close-btn::before {
    content: "\00d7";
    font-size: 1.4rem;
    line-height: 1;
    color: inherit;
    font-weight: 600;
}

/* If a real icon is present, hide the fallback glyph. */
.modal-header .close:has(i)::before,
.modal-header .modal-close-btn:has(i)::before {
    content: none;
}

.modal-header .close:has(i) > i,
.modal-header .modal-close-btn:has(i) > i {
    font-size: 0.95rem;
}

.modal-body {
    padding: 10px;
    text-align: left;
}

.modal-footer {
    border-top: 1px solid rgba(127, 127, 127, 0.16);
    padding: 0.75rem 1.1rem;
    gap: 0.5rem;
}

.modal-footer .btn {
    min-height: 2.4rem;
    padding: 0 1.2rem;
    border-radius: 10px;
    font-weight: 600;
}
