/* Frontend Popup Styles */
.oshama-popup-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.oshama-popup-wrapper.oshama-popup-open {
    visibility: visible;
    opacity: 1;
}

.oshama-popup-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.oshama-popup-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    max-width: 90%;
    max-height: 90vh;
    z-index: 10;
    /* Glassmorphism option */
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.95);
}

.oshama-popup-content {
    overflow-y: auto;
    max-height: calc(90vh - 40px);
}

.oshama-popup-close {
    position: absolute;
    z-index: 999;
    background: #fff !important;
    color: #111 !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    cursor: pointer;
    font-size: 24px !important;
    line-height: 36px !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

.oshama-popup-close:hover {
    transform: scale(1.1);
    background: #f3f4f6 !important;
}

/* Close Positions */
.oshama-popup-close.top-right { top: 10px; right: 10px; }
.oshama-popup-close.top-left { top: 10px; left: 10px; }
.oshama-popup-close.bottom-right { bottom: 10px; right: 10px; }
.oshama-popup-close.bottom-left { bottom: 10px; left: 10px; }

/* Animations */
@keyframes oshama-popup-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes oshama-popup-slide-up { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes oshama-popup-slide-down { from { transform: translateY(-100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes oshama-popup-zoom-in { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes oshama-popup-bounce { 
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.anim-fade { animation: oshama-popup-fade 0.4s ease-out; }
.anim-slide-up { animation: oshama-popup-slide-up 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); }
.anim-slide-down { animation: oshama-popup-slide-down 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); }
.anim-zoom-in { animation: oshama-popup-zoom-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.anim-bounce { animation: oshama-popup-bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* Body scroll disable */
body.oshama-popup-no-scroll {
    overflow: hidden;
}

.oshama-popup-cta-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Responsive video container styling */
.oshama-popup-video-container {
    position: relative;
    padding-bottom: 56.25%; /* Default landscape 16:9 */
    height: 0;
    overflow: hidden;
    width: 100%;
    background: #000;
}

.oshama-popup-video-container.landscape {
    padding-bottom: 56.25%; /* 16:9 */
}

.oshama-popup-video-container.portrait {
    padding-bottom: 177.78%; /* 9:16 aspect ratio */
    min-width: 100% !important;
}

@media (min-width: 769px) {
    .oshama-popup-video-container.landscape {
        min-width: 600px;
    }
    .oshama-popup-video-container.portrait {
        min-width: 100% !important;
    }
}

.oshama-popup-video-container video,
.oshama-popup-video-container .wp-video,
.oshama-popup-video-container .wp-video-shortcode {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.oshama-popup-video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Beautiful glass-smooth, fully transparent overlay to catch hover/pointer events */
.oshama-popup-video-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 100 !important;
    background: transparent !important;
    pointer-events: auto !important;
    transition: opacity 0.3s ease, pointer-events 0.3s ease !important;
}

/* When the video container is hovered, disable the overlay */
.oshama-popup-video-container:hover .oshama-popup-video-overlay {
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Specific styles for HTML type popups */
.oshama-popup-type-html .oshama-popup-content {
    padding: 32px;
    box-sizing: border-box !important;
}

.oshama-popup-type-html .oshama-popup-content > *:first-child {
    margin-top: 0 !important;
}

.oshama-popup-type-html .oshama-popup-content > *:last-child {
    margin-bottom: 0 !important;
}

/* Auto stretch forms and dynamic blocks inside HTML popups */
.oshama-popup-type-html .oshama-popup-content form,
.oshama-popup-type-html .oshama-popup-content .wpcf7,
.oshama-popup-type-html .oshama-popup-content .fluentform,
.oshama-popup-type-html .oshama-popup-content .fluentform form,
.oshama-popup-type-html .oshama-popup-content .gform_wrapper,
.oshama-popup-type-html .oshama-popup-content .gform_wrapper form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Custom scrollbars */
.oshama-popup-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.oshama-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

.oshama-popup-content::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 10px;
}

.oshama-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Custom floating mute/unmute button for HTML5 self-hosted video */
.oshama-popup-mute-toggle {
    transition: opacity 0.3s ease, transform 0.2s ease, background-color 0.2s ease !important;
}

.oshama-popup-mute-toggle:hover {
    transform: scale(1.1) !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
}

/* Hide custom mute toggle on container hover */
.oshama-popup-video-container:hover .oshama-popup-mute-toggle {
    opacity: 0 !important;
    pointer-events: none !important;
}
