/**
 * WPE YouTube Modal - Frontend Styles
 * Reusable modal popup for YouTube videos
 */

/* Modal Overlay - Glass blur effect */
.wpe-ytm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpe-ytm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--wpe-ytm-overlay-opacity, 0.7));
    backdrop-filter: blur(var(--wpe-ytm-blur, 12px));
    -webkit-backdrop-filter: blur(var(--wpe-ytm-blur, 12px));
}

/* Content container - 16:9 aspect ratio */
.wpe-ytm-container {
    position: relative;
    width: 90vw;
    max-width: var(--wpe-ytm-max-width, 1200px);
    z-index: 1;
}

.wpe-ytm-content {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: var(--wpe-ytm-border-radius, 12px);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    background: #000;
}

.wpe-ytm-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Close button */
.wpe-ytm-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 36px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.wpe-ytm-close:hover {
    color: #ffffff;
    transform: scale(1.15);
}

/* Title below video */
.wpe-ytm-title {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-top: 16px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpe-ytm-title:empty {
    display: none;
}

/* Fade-in animation */
.wpe-ytm-modal.wpe-ytm-active {
    animation: wpeYtmFadeIn 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .wpe-ytm-container {
        width: 95vw;
    }

    .wpe-ytm-close {
        top: -40px;
        font-size: 28px;
    }

    .wpe-ytm-title {
        font-size: 14px;
        margin-top: 12px;
    }
}

/* Print */
@media print {
    .wpe-ytm-modal {
        display: none !important;
    }
}
