/**
 * WPE Video Preview & Notice Box Styling
 * Version: 1.0.0
 * Ensures preview and notice match featured image dimensions
 */

/* Container positioning */
.wpe-video {
    position: relative;
}

.wpe-video figure.wp-block-post-featured-image {
    position: relative;
    margin: 0;
    overflow: hidden;
}

/* Iframe Preview - Match Featured Image */
.wpe-video .wpe-preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: inherit;
    z-index: 2;
}

/* Animated WebP Preview - Match Featured Image */
.wpe-video img.is-previewing {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

/* Notice Box Overlay - Match Featured Image */
.wpe-video .wpe-preview-notice {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    border-radius: inherit;
    z-index: 10;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Notice Content */
.wpe-preview-notice-content {
    text-align: center;
    max-width: 90%;
}

.wpe-preview-notice-text {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Watch More Button */
.wpe-watch-more-btn {
    display: inline-block;
    background: #FF0000;
    color: #ffffff !important;
    padding: 12px 32px;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    height:auto !important;
}

.wpe-watch-more-btn:hover {
    background: #CC0000 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4);
}

.wpe-watch-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 0, 0, 0.3);
}

/* Ensure figure keeps aspect ratio */
.wpe-video figure[style*="aspect-ratio"] {
    position: relative;
    overflow: hidden;
}

/* Hide original image when iframe is playing */
.wpe-video img[style*="display: none"] {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wpe-preview-notice-text {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .wpe-watch-more-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .wpe-preview-notice-text {
        font-size: 14px;
    }
    
    .wpe-watch-more-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
    
    .wpe-preview-notice {
        padding: 15px;
    }
}

/* Ensure border-radius inheritance */
.wpe-video .wpe-preview-iframe,
.wpe-video .wpe-preview-notice {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Optional: Smooth transitions */
.wpe-video img {
    transition: opacity 0.3s ease;
}

.wpe-video .wpe-preview-notice {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}