/* Container Wrapper Styles */
.vdo-popup-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    overflow: hidden;
    z-index: 9999;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* Container for video to keep 16:9 aspect ratio */
.vdo-popup-player-container {
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    overflow: hidden;
    background-color: black;
}

/* iframe inside container */
.vdo-popup-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Title bar */
.vdo-popup-title-bar {
    padding: 10px 15px;
    font-weight: bold;
    font-size: 15px;
    background: #e24329;
    color: white;
    text-align: center;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    line-height: 1.4;
}

/* Close button */
.vdo-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50% !important;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 0 !important;
    margin: 0 !important;
}

.vdo-popup-close:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Elementor Edit Mode override ให้เห็นชัดแบบ Relative ในโหมดแก้ไข */
.elementor-editor-active .vdo-popup-wrapper {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    margin: 20px auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vdo-popup-wrapper {
        width: 280px;
        right: 15px;
        bottom: 15px;
    }
}
