/* Base modal container (hidden by default) */
.modal {
    display: none;
    position: fixed;   /* must be fixed */
    top: 0;
    left: 0;
    width: 100vw;      /* full viewport width */
    height: 100vh;     /* full viewport height */
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);

    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}


/* Modal content */
.modal-content {
    background: var(--white);
    border: 1px solid var(--grey);
    border-radius: 8px;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    height: 70%;
    box-sizing: border-box;
    overflow: auto;
}

/* When modal is open */
.modal.show {
    display: flex;
}

/* Close button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--black);
}

#main-content.modal-open {
    overflow: hidden;
    height: calc(100dvh - 48px);
}

#modal-iframe {
    height: calc(100% - 40px);
}

/* DOUBLE CLICK MODAL */
/* Modal content */
#dblClickModal .modal-content {
    max-width: 800px;
    max-height: 80vh;
    /* limit height */
    overflow: hidden;
    /* hide overflow */
    position: relative;
}

/* Table scroll */
.table-cont{
    height: 100%;
    overflow-y: scroll;
}
#dblclick-modal-table {
    overflow-y: auto;
    height: 100%;
}

/* Optional: keep table headers visible if you add <thead> */
#dblclick-modal-table thead {
    display: table;
    width: 100%;
    table-layout: fixed;
}

#dblclick-modal-table tbody {
    width: 100%;
}


/* Mobile fullscreen */
@media (max-width: 768px) {
    .modal {
        align-items: stretch;
        justify-content: stretch;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        padding: 0;
    }

    #modal-iframe {
        width: 100%;
        height: calc(100% - 80px);
        border: none;
    }
}