﻿/**************************\
  Basic Modal Styles
\**************************/

.modal {
    font-family: "Open Sans", sans-serif;
}

.modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(154, 171, 179, 0.40);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure the overlay is above other elements */
}

.modal__container {
    width: auto; /* Default to auto width for auto-grow */
    height: auto; /* Default to auto height for auto-grow */
    max-width: 100%; /* Limit maximum width */
    max-height: 100vh; /* Limit maximum height */
    overflow-y: auto; /* Enable scrolling if content exceeds viewport height */
    background-color: #fff;
    border-radius: 4px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px 0 rgba(38, 82, 104, 0.10), 0 8px 24px 0 rgba(22, 60, 92, 0.26);
    border-top: 4px solid #003247;
    z-index: 10000; /* Ensure the modal container is above the overlay */
}

/* modal header */

.modal__header {
    padding: 24px;
}

.modal__title {
    font-size: 18px;
    color: #003247;
    letter-spacing: -0.3px;
    text-align: left;
    font-weight: 700;
    line-height: 24px;
}

.modal__close {
    background: transparent url(/assets/icons/icon-cancel-round-darkgrey-24.svg) center center no-repeat;
    border: 0;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    position: absolute;
    right: 12px;
    top: 12px;
}


/* modal content */

.modal__content {
    padding: 0 24px 24px 24px; /* Add padding at the bottom to create space above the footer */
    max-height: 60vh; /* Set a maximum height to limit the content area */
    overflow-y: auto; /* Enable vertical scrolling if content exceeds max height */
    box-sizing: border-box; /* Ensure padding is included in the element's dimensions */
}

.modal__content> * {
    margin-bottom: 24px;
}

.modal__content form> :not(:last-child) {
    margin-bottom: 16px;
}

.modal__content form {
    margin-bottom: 24px;
}

/* inputs */

.modal__content input:not([type="checkbox"]) {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    background-color: #fff;
    border: 1px solid #c7d2d9;
    border-radius: 4px;
    font-size: 14px;
    outline: 0;
    padding: 0 8px;
    height: 40px;
    line-height: 40px;
    width: 100%;
}

.modal__content select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: 0;
    background: #fff url(/assets/icons/icon-arrowdown-darkgrey-12.svg) right 8px center no-repeat;
    border: 1px solid #c7d2d9;
    border-radius: 4px;
    padding: 0 8px;
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    width: 100%;
    cursor: pointer;
}

.modal__content input:hover,
.modal__content select:hover {
    border-color: #9aabb3;
}

.modal__content input:focus-visible,
.modal__content select:focus-visible {
    border-color: #0092d2;
}

.modal__content input:disabled,
.modal__content select:disabled,
.modal__content input.disabled,
.modal__content select.disabled {
    color: #74838a;
    background-color: #f6f9fc;
    pointer-events: none;
}

/* modal footer */

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding: 12px 24px;
    background: #F6F9FC;
    margin-top: 16px; /* Add margin above the footer to create space */
}

.modal__footer>* {
    margin: 4px;
}



/**************************\
  Demo Animation Style
\**************************/
@keyframes mmfadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mmfadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes mmslideIn {
    from {
        transform: translateY(15%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes mmslideOut {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10%);
    }
}

.micromodal-slide {
    display: none;
}

.micromodal-slide.is-open {
    display: block;
}

.micromodal-slide[aria-hidden="false"] .modal__overlay {
    animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="false"] .modal__container {
    animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__overlay {
    animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__container {
    animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);
}

.micromodal-slide .modal__container,
.micromodal-slide .modal__overlay {
    will-change: transform;
}

/* Use the theme loader-wheel colors for the modal spinner */
.modal .spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid var(--loader-wheel-border-color);
    border-top: 2px solid var(--loader-wheel-border-left-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 0.5em;
}

@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}
