/* Newsletter PDF Modal */
.newsletter-pdf-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.newsletter-pdf-modal.active {
    display: flex;
}

/* Overlay */
.newsletter-pdf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

/* Modal Container */
.newsletter-pdf-container {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Header */
.newsletter-pdf-header {
    height: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #ddd;
    background: #fff;
    flex-shrink: 0;
}

.newsletter-pdf-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #173b63;
}

/* Close Button */
.newsletter-pdf-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: #fff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Close Icon */
.newsletter-pdf-close img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
}

/* Hover */
.newsletter-pdf-close:hover {
    background: #f1f1f1 !important;
}

/* PDF Content */
.newsletter-pdf-content {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #f5f5f5;
}

/* PDF iframe */
.newsletter-pdf-content iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Disable Background Scrolling */
body.newsletter-modal-open {
    overflow: hidden;
}

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

    .newsletter-pdf-container {
        width: 96%;
        height: 94vh;
        max-height: 94vh;
        border-radius: 6px;
    }

    .newsletter-pdf-header {
        height: 50px;
        min-height: 50px;
        padding: 0 12px;
        flex-shrink: 0;
    }

    .newsletter-pdf-header h2 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-right: 10px;
    }

    .newsletter-pdf-close {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .newsletter-pdf-close img {
        width: 18px;
        height: 18px;
    }

     /* Important for mobile touch scrolling */
    .newsletter-pdf-content {
        flex: 1;
        min-height: 0;
        width: 100%;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .newsletter-pdf-content iframe {
        width: 100%;
        height: 100%;
        min-height: 100%;
        border: none;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
}

/* Very Small Mobile Devices */
@media (max-width: 480px) {
    .newsletter-pdf-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .newsletter-pdf-header {
        padding: 0 10px;
    }

    .newsletter-pdf-header h2 {
        font-size: 15px;
    }
}