/**
 * E2N Media Modal Styles
 * 
 * @since 1.0.0
 */

/* ==========================================================================
   Base Modal Styles
   ========================================================================== */

#mediaModal.e2n-media-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 13px 60px #000e46;
    max-width: none;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    display: none;
}

.e2n-media-modal-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.e2n-media-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Close Button
   ========================================================================== */

.e2n-media-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10001;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.e2n-media-modal-close svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: #999;
    transition: fill 0.3s ease;
}

.e2n-media-modal-close:hover svg {
    fill: #333;
}

/* ==========================================================================
   Content Container
   ========================================================================== */

.e2n-media-modal-content {
    width: 100%;
    min-height: 200px;
    box-sizing: border-box;
    padding: 50px 30px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Iframe Base Styles
   ========================================================================== */

.e2n-media-modal-iframe {
    border: none;
    background: #fff;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Content Type Specific Styles
   ========================================================================== */

/* Page/Blog Posts - Use most viewport space */
#mediaModal.media-modal-blogpost {
    max-width: 95vw;
    width: 95vw;
}

#mediaModal.media-modal-blogpost .e2n-media-modal-iframe-blogpost {
    width: 100%;
    height: 80vh;
    min-height: 500px;
}

/* PDF - Maximize height with proper aspect ratio */
#mediaModal.media-modal-pdf {
    height: calc(100vh - 40px);
    max-height: 95vh;
    width: auto;
    padding: 20px 0;
    box-sizing: border-box;
}
#mediaModal.media-modal-pdf .e2n-media-modal-iframe-pdf {
    height: 100%;
    max-height: 100%;
    width: calc((100vh - 40px) / 1.7);
    max-width: 95vw;
    aspect-ratio: 1 / 1.45;
    display: block;
    margin: 20px auto 0;
}

/* YouTube - Full width minus padding, height for 16:9 aspect ratio */
#mediaModal.media-modal-youtube {
    width: calc(100vw - 40px);
    max-width: 1200px;
    padding: 20px 0;
    box-sizing: border-box;
}
#mediaModal.media-modal-youtube .e2n-media-modal-iframe-youtube {
    width: 100%;
    height: calc((100vw - 40px) * 9 / 16);
    max-width: 1200px;
    max-height: 80vh;
    aspect-ratio: 16 / 9;
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.e2n-media-modal-loading,
.e2n-media-modal-error {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 40px;
    text-align: center;
}

.e2n-media-modal-loading {
    color: #fff;
}

.e2n-media-modal-error {
    color: #ff6b6b;
    font-size: 16px;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
    #mediaModal.e2n-media-modal {
        border-radius: 12px;
        max-width: 95vw;
    }
    
    .e2n-media-modal-close {
        top: 8px;
        right: 8px;
    }
    
    .e2n-media-modal-close svg {
        width: 16px;
        height: 16px;
    }
    
    .e2n-media-modal-content {
        padding: 40px 15px 15px;
    }
    
    #mediaModal.media-modal-blogpost .e2n-media-modal-iframe-blogpost,
    #mediaModal.media-modal-pdf .e2n-media-modal-iframe-pdf,
    #mediaModal.media-modal-youtube .e2n-media-modal-iframe-youtube {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    #mediaModal.e2n-media-modal {
        border-radius: 8px;
        max-width: 98vw;
    }
    
    .e2n-media-modal-close {
        top: 6px;
        right: 6px;
        width: 28px;
        height: 28px;
    }
    
    .e2n-media-modal-close svg {
        width: 14px;
        height: 14px;
    }
    
    .e2n-media-modal-content {
        padding: 35px 10px 10px;
    }
}

body.e2n-media-modal #header-space,
body.e2n-media-modal #header-outer,
body.e2n-media-modal #footer-outer,
body.e2n-media-modal #single-meta,
body.e2n-media-modal #containerCookieBanner,
body.e2n-media-modal .post-tags,
body.e2n-media-modal .blog_next_prev_buttons,
body.e2n-media-modal .related-post-wrap,
body.e2n-media-modal .comments-section
{
    display: none !important;
}