/* Responsive Preview Modal */
.modal-preview {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content-preview {
    display: flex;
    flex-direction: column;
    width: 95%;
    max-height: 90vh;
    margin: 20px auto;
    background-color: #FAF9F6;
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .modal-content-preview {
        flex-direction: row;
        width: 80%;
        height: 80vh;
        margin: 10vh auto;
    }
}

/* Preview area responsiveness */
.preview-area {
    width: 100%;
    height: 50vh;
    padding: 20px;
    background-color: #9c9c9c7f;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

@media (min-width: 768px) {
    .preview-area {
        width: 70%;
        height: auto;
    }
}

/* Details area responsiveness */
.details-area {
    width: 100%;
    padding: 20px;
    background-color: #FAF9F6;
    border-top: 1px solid #e0e0e0;
    font-family: 'Roboto', sans-serif;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .details-area {
        width: 30%;
        border-top: none;
        border-left: 1px solid #e0e0e0;
    }
}

/* Responsive typography */
.details-area h3 {
    font-size: calc(1.1rem + 0.3vw);
    margin-bottom: 15px;
    color: #333;
    font-weight: bold;
}

.details-area p {
    font-size: calc(0.9rem + 0.1vw);
    margin: 10px 0;
    color: #555;
}

/* Touch-friendly download button */
#modalDownloadBtn
#modalEmailBtn {
    width: 100%;
    padding: 12px 20px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 44px;
    text-align: center;
    margin-top: 20px;
}

@media (min-width: 768px) {
    #modalDownloadBtn {
        width: auto;
        display: inline-block;
    }
}

/* Close button enhancement */
.close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 10px;
    z-index: 1100;
    touch-action: manipulation;
}

/* Media elements responsiveness */
img, video, iframe, audio {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

/* Smooth transitions */
.modal-preview {
    transition: opacity 0.3s ease;
}

/* Touch-friendly scrollbars */
.preview-area, .details-area {
    scrollbar-width: thin;
    scrollbar-color: #ff0000 #f1f1f1;
}

.preview-area::-webkit-scrollbar,
.details-area::-webkit-scrollbar {
    width: 8px;
}

.preview-area::-webkit-scrollbar-track,
.details-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.preview-area::-webkit-scrollbar-thumb,
.details-area::-webkit-scrollbar-thumb {
    background: #ff0000;
    border-radius: 4px;
}

/* Ensure preview modal styles do not affect other buttons */
.modal-preview .save-button {
    /* Add any specific styles for save-button within preview modal if needed */
}

