/* ============================================================
 * WEBINAR FRONTEND — GLOBAL & DESKTOP
 * ============================================================ */

/* Shell */
#ubp-webinar-shell {
    padding: 0 16px;
}

/* Video display */
#ubp-video-wrapper iframe,
#ubp-video-wrapper video,
#ubp-video-wrapper stream {
    display: overflowe;
    width: 100%;
}

/* Start button (desktop) */
#ubp-start-btn {
    transition: transform 0.15s ease;
}
#ubp-start-btn:active {
    transform: scale(0.97);
}

/* Default popup font size */
#ubp-webinar-join-popup {
    font-size: 13px;
}

/* ============================================================
 * FONT GLOBAL UNTUK POPUP (Poppins)
 * ============================================================ */
#ubp-cta-hint,
#ubp-webinar-join-popup {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.2px;
}


/* ============================================================
 * MOBILE FIRST — RESPONSIVE UI
 * ============================================================ */
@media (max-width: 768px) {

    /* Shell */
    #ubp-webinar-shell {
        padding: 0 12px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Start button lebih kecil */
    #ubp-start-btn {
        padding: 10px 20px !important;
        font-size: 16px !important;
        border-radius: 999px !important;
    }

    /* Video */
    #ubp-video-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px !important;
        margin-top: 16px !important;
    }

    #ubp-video-wrapper iframe,
    #ubp-video-wrapper video,
    #ubp-video-wrapper stream {
        width: 100% !important;
        height: auto !important;
    }

    /* Chat input vertical */
    .ubp-chat-input-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .ubp-chat-input-row input,
    .ubp-chat-input-row button {
        width: 100% !important;
    }
    .ubp-chat-input-row input { margin-bottom: 6px; }

    /* Chat box */
    #ubp-webinar-chat-wrap {
        margin-top: 18px !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    #ubp-webinar-chat-box {
        height: 200px !important;
        font-size: 12px !important;
        line-height: 1.4;
    }

    #ubp-viewer-widget { font-size: 13px !important; }

    /* CTA Sticky bottom */
    #ubp-webinar-cta {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 8px 12px;
        background: rgba(0,0,0,0.9);
        z-index: 9998;
        text-align: center;
    }

    #ubp-webinar-cta-btn {
        display: inline-block;
        width: 100%;
        max-width: 480px;
    }
}


/* ============================================================
 * CTA PROMO POPUP — PREMIUM CLEAN GOLD
 * ============================================================ */
/* ============================================================
   CTA PROMO — TikTok Style Slide-Up
============================================================ */
#ubp-cta-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(40px); /* start below */
    
    padding: 10px 22px;
    max-width: 90%;
    width: max-content;
    
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(190, 190, 190, 0.226);
    color: #fff;

    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 400;
    border-radius: 40px; /* bubble */
    white-space: nowrap;

    display: none;
    opacity: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 999999;

    transition: all .35s cubic-bezier(.25,.46,.45,.94);
}

#ubp-cta-hint.show {
    display: block !important;
    opacity: 1;
    transform: translateX(-50%) translateY(0);  /* smooth slide up */
}
/* ============================================================
 * FAKE JOIN POPUP — PREMIUM CLEAN
 * ============================================================ */
/* ============================================================
   FAKE JOIN — TikTok Style Slide-Up
============================================================ */
#ubp-webinar-join-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);

    padding: 10px 24px;
    max-width: 90%;
    width: max-content;

    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;

    font-family: 'Poppins', sans-serif;
    font-size: 11px !important;
    letter-spacing: 0.2px;

    border-radius: 40px; /* bubble */
    white-space: nowrap;

    display: none;
    opacity: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 999999;

    transition: all .35s cubic-bezier(.25,.46,.45,.94);
}

#ubp-webinar-join-popup-icon {
    font-size: 12px;
    margin-right: 6px;
}

#ubp-webinar-join-popup.show {
    display: block !important;
    opacity: 1;
    transform: translateX(-50%) translateY(0); /* slide up */
}
/* ============================================================
 * ANIMATIONS
 * ============================================================ */
@keyframes ubpFadeIn {
    from { opacity: 0; transform: translateX(-50%) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes ubpFadeInUp {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   MOBILE VIDEO BOOSTER — FULL WIDTH HERO VIDEO
   ============================================================ */
@media only screen and (max-width: 768px) {

    /* Wrapper video dibuat lebih dominan */
    #ubp-video-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px !important;
        margin-top: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 6px 18px rgba(0,0,0,0.35) !important;
    }

    /* Video/Vimeo/Cloudflare full hero dengan rasio 16:9 */
    #ubp-video-wrapper iframe,
    #ubp-video-wrapper video,
    #ubp-video-wrapper stream {
        width: 100% !important;
        height: 62vw !important; /* Rasio paling ideal untuk mobile webinar */
        max-height: none !important;

        object-fit: cover !important;
        border-radius: 12px !important;
        background:#000;
        display:block !important;
    }

    /* Overlay tombol start tetap full video */
    #ubp-start-overlay {
        border-radius: 12px !important;
    }
}

/* ============================================================
   YOUTUBE LIVE MODE — MOBILE FULLSCREEN VIDEO
   ============================================================ */
@media only screen and (max-width: 768px) {

    /* 0. Hilangkan judul & mode info */
    #ubp-webinar-shell h1,
    #ubp-webinar-shell > div:nth-child(2) {
        display: none !important;
    }

    /* 1. Shell tanpa padding */
    #ubp-webinar-shell {
        padding: 0 !important;
    }

    /* 2. HEADER BAR ala YouTube Live */
    #ubp-webinar-header-live {
        display: flex;
        align-items: center;
        gap: 10px;

        padding: 12px 14px;
        background: #000;
        color: #fff;
        font-family: system-ui, sans-serif;
        font-size: 15px;
        font-weight: 600;
    }

    #ubp-live-dot {
        display:inline-block;
        width:10px;
        height:10px;
        background:red;
        border-radius:50%;
        margin-left:4px;
    }

    /* 3. VIDEO FULLSCREEN (top + full width) */
    #ubp-video-wrapper {
        border-radius: 0 !important;
        margin-top: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        background:#000;
    }

    #ubp-video-wrapper video,
    #ubp-video-wrapper iframe,
    #ubp-video-wrapper stream {
        width: 100vw !important;
        height: 56.25vw !important; /* 16:9 ratio */
        border-radius: 0 !important;
        display: block !important;
        object-fit: cover !important;
    }

    /* 4. Overlay start menyesuaikan fullscreen */
    #ubp-start-overlay {
        border-radius: 0 !important;
    }

    /* 5. Chat tetap rapi */
    #ubp-webinar-chat-wrap {
        padding: 14px !important;
        margin-top: 12px;
    }
}

/* ============================================================
   MOBILE LIVE HEADER — YouTube Style (No Back Icon)
   ============================================================ */
@media (max-width: 768px) {

    #ubp-webinar-header-live {
        display: flex !important;
        align-items: center;
        justify-content: center; /* center like YouTube */
        gap: 6px;

        width: 100%;
        padding: 12px 0;
        background: #000;
        color: #fff;

        font-family: system-ui, sans-serif;
        font-size: 15px;
        font-weight: 600;

        position: sticky;
        top: 0;
        z-index: 9999; /* always on top */
    }

    #ubp-live-dot {
        width: 10px;
        height: 10px;
        background: red;
        border-radius: 50%;
        display: inline-block;
        animation: liveBlink 1.3s infinite;
    }

    @keyframes liveBlink {
        0% { opacity: 1; }
        50% { opacity: .3; }
        100% { opacity: 1; }
    }
}

/* =====================================================================
   FINAL HEADER FIX — MOBILE FULL WIDTH 100vw (NO BOXED)
===================================================================== */
@media (max-width: 768px) {

    /* Pastikan parent tidak memberi padding */
    #ubp-webinar-shell {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* HEADER FULLSCREEN */
    #ubp-webinar-header-live {
        width: 100vw !important;        /* BUKAN 100% */
        max-width: 100vw !important;

        margin: 0 !important;
        padding: 10px 12px !important;

        position: sticky !important;
        top: 0 !important;
        left: 0 !important;

        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;

        background: #000 !important;
        color: #fff !important;

        font-family: system-ui, sans-serif;
        font-size: 13px !important;      /* sesuai permintaan: kecil */
        font-weight: 400 !important;

        z-index: 99999 !important;
    }

    /* Bagian right: LIVE dan viewer counter tetap besar */
    #ubp-webinar-header-live .header-right,
    #ubp-webinar-header-live #ubp-live-dot,
    #ubp-webinar-header-live #ubp-viewer-count {
        font-size: 15px !important;
        font-weight: 600 !important;
    }

    /* Dot LIVE tetap animasi */
    #ubp-live-dot {
        width: 10px !important;
        height: 10px !important;
        background: red !important;
        border-radius: 50% !important;
        animation: liveBlink 1.2s infinite !important;
    }

    @keyframes liveBlink {
        0% { opacity: 1; }
        50% { opacity: .3; }
        100% { opacity: 1; }
    }
}

/* ===============================
   NO HORIZONTAL SCROLL MOBILE
=============================== */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100vw !important;
        touch-action: pan-y !important; /* hanya scroll vertikal */
        overscroll-behavior-x: none !important;
    }

    /* Semua container di dalam tidak boleh melewati viewport */
    #ubp-webinar-shell,
    #ubp-video-wrapper,
    #ubp-webinar-header-live,
    #ubp-webinar-chat-wrap {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

/* ===============================
   FIX IOS AUTO-ZOOM ON INPUT
=============================== */
@media (max-width: 768px) {

    /* wajib min 16px agar iPhone tidak zoom */
    input,
    textarea {
        font-size: 16px !important;
    }

    /* jika mau terlihat lebih kecil, pakai scale visual */
    .ubp-chat-input-row input {
        transform: scale(0.92);
        transform-origin: left center;
    }
}

/* ===============================
   DISABLE PINCH / DOUBLE TAP ZOOM
=============================== */
@media (max-width: 768px) {
    html, body {
        touch-action: pan-y !important; 
    }

    /* Matikan tap dua kali memperbesar */
    * {
        touch-action: manipulation !important;
    }
}



/* ===============================================
   FULL BLEED MODE KHUSUS MOBILE < 768px
=============================================== */
@media (max-width: 768px) {

    /* FORCE ROOT WRAPPER FULLSCREEN */
    #ubp-webinar-shell {
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        padding: 0 !important;
    }

    /* HEADER FULL WIDTH */
    #ubp-webinar-header-live {
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
    }

    /* VIDEO WRAPPER FULL BLEED */
    #ubp-video-wrapper {
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        padding: 0 !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }

    #ubp-video-wrapper iframe,
    #ubp-video-wrapper video,
    #ubp-video-wrapper stream {
        width: 100vw !important;
        height: 56.25vw !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }
}

@keyframes ubpLiveDotBlink {
    0% { opacity: 1; }
    50% { opacity: .3; }
    100% { opacity: 1; }
}
#ubp-video-wrapper iframe {
    filter: brightness(1);
}

/* Sembunyikan UI sebisa mungkin */
#ubp-video-wrapper iframe::-webkit-media-controls {
    display: none !important;
}


#ubp-join-toast-v2 {
    position: fixed;
    bottom: 90px;
    left: 20px;
    background: rgba(15,23,42,.94);
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    box-shadow: 0 15px 40px rgba(0,0,0,.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
    animation: joinToastIn .35s ease-out;
}

#ubp-join-toast-v2 .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg,#22c55e,#16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #022c22;
    font-weight: bold;
    font-size: 14px;
}

#ubp-join-toast-v2 .text {
    line-height: 1.2;
}

#ubp-join-toast-v2 .name {
    color: #22c55e;
    font-weight: 600;
}

#ubp-join-toast-v2 .meta {
    font-size: 11px;
    color: #9ca3af;
}

@keyframes joinToastIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}