/* MODAL SESSIONS */
.modal-session {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Remove the ::before pseudo-element from modal (was used for anchor scrolling) */
.modal-session::before {
    content: none !important;
}

.modal-session.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: -1;
}

.modal-content {
    position: relative;
    background-color: transparent;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    width: 100%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.modal-content-available {
    height: auto;
    max-height: 90vh;
}

.modal-content-available .result-style-container {
    flex: 0 1 auto;
    overflow-y: visible;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--dark-magenta);
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 50px;
    align-self: flex-end;
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    z-index: 10;
}

.modal-close-btn:hover {
    color: var(--light-magenta);
    transform: scale(1.2);
}

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

/* Remove the ::before pseudo-element spacing from modal */
.modal-session .result-box::before {
    content: none;
}

/* Adjust result-style-container inside modal */
.modal-session .result-style-container {
    padding: 1em;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.modal-session .result-box-body {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

.modal-content-extra {
    max-width: 560px;
    height: auto;
    max-height: 90vh;
}

.modal-extra-session-container {
    padding-top: 3.2em;
}

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

/* Mobile responsiveness */
@media screen and (max-width: 1410px) {
    .modal-session {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        height: 95vh;
    }

    .modal-content-available {
        height: auto;
        max-height: 95vh;
    }

    .modal-content-extra {
        height: auto;
        max-height: 95vh;
    }

    .modal-close-btn {
        font-size: 1.8em;
        min-width: 40px;
        min-height: 40px;
    }

    .modal-session .result-box-body {
        padding-left: 0.3em;
        padding-right: 0.3em;
    }

    textarea {
        width: 98% !important;
    }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
    .modal-session {
        padding: 5px;
    }

    .modal-content {
        max-width: 100%;
        height: 95vh;
        border-radius: 0;
    }

    .modal-content-available {
        height: auto;
        max-height: 95vh;
    }

    .modal-content-extra {
        height: auto;
    }

    .modal-close-btn {
        font-size: 1.6em;
        min-width: 36px;
        min-height: 36px;
    }

    .modal-session .result-style-container {
        padding: 0.7em;
    }

    .modal-session .result-box-body {
        padding-left: 0.2em;
        padding-right: 0.2em;
    }
}
