/* ===================================
   MODALS
   =================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

/* Right Side Slider Modal marker */
.modal-slider {
    overflow: hidden;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

/* Center variant dialog */
.modal-center .modal-dialog {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: all var(--transition-normal);
}

.modal-center.show .modal-dialog {
    transform: scale(1);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Slider variant dialog */
.modal-slider .modal-dialog {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    max-width: 600px;
    height: 100vh;
    margin: 0;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-slider.show .modal-dialog {
    transform: translateX(0);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    outline: 0;
    box-shadow: -0.5rem 0 1rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* Variant-specific body height constraints */
.modal-center .modal-body {
    max-height: calc(90vh - 160px);
}

.modal-slider .modal-body {
    max-height: calc(100vh - 160px);
}

.modal-footer {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem !important;
    justify-content: flex-end !important;
    padding: 1.25rem 2rem !important;
    border-top: 1px solid #e5e7eb !important;
    background-color: #f9fafb !important;
    flex-shrink: 0 !important;
    /* Fixed footer - no margin-top needed with proper flexbox */
}

.btn-close {
    box-sizing: content-box;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--gray-600);
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    opacity: 0.7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1;
    transition: all 0.15s ease-in-out;
}

.btn-close:hover {
    opacity: 1;
    background-color: #f3f4f6;
    color: #374151;
}

.btn-close::before {
    content: "×";
}

/* Responsive styles */

@media (max-width: 768px) {

    .modal-center .modal-dialog,
    .modal-slider .modal-dialog {
        width: 100%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 480px) {

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .modal-title {
        font-size: 1.125rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
        min-height: auto;
    }

}