/* Custom Image Modal */
.img-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Less dark */
    backdrop-filter: blur(4px);
    /* Faded effect */
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.img-modal-details {
    flex-shrink: 1;
    overflow-y: auto;
    margin-top: 15px;
    text-align: left;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.img-modal-details p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
    overflow-wrap: break-word;
    word-break: break-word;
}

.img-modal-details strong {
    color: #0F44B6;
}

.img-modal-content {
    position: relative;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 85vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.img-modal-content img {
    max-width: 100%;
    max-height: 40vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
}

.img-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 0;
    padding-bottom: 3px;
}

/* Modal optimizations for small/short screens */
@media (max-width: 500px),
(max-height: 600px) {
    .img-modal-content {
        padding: 10px;
    }

    .img-modal-content img {
        max-height: 45vh;
    }

    .img-modal-details {
        margin-top: 10px;
        padding-top: 5px;
    }

    .img-modal-details p {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .img-modal-close {
        width: 25px;
        height: 25px;
        font-size: 16px;
        top: -10px;
        right: -10px;
    }
}

/* Remove table borders and backgrounds from the details table, overriding global theme styles */
.img-modal-details table,
.img-modal-details tr {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.img-modal-details td {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif !important;
    font-size: 14px !important;
    text-align: left !important;
    vertical-align: top !important;
    line-height: 1.4 !important;
    color: #333 !important;
}

/* Force scrollbar to be permanently visible by default on WebKit browsers */
.img-modal-details::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 6px;
    height: 6px;
}

.img-modal-details::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background-color: #0F44B6;
    box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

.img-modal-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}




