/* WDP Showlink Popup Styles — aligned to 2.3 spec */
:root {
    --wdpsl-primary-color: #7C2EC9;
    --wdpsl-bg-dark: rgba(15, 23, 42, 0.6);
    --wdpsl-header-bg: #333333;
    --wdpsl-body-bg: transparent;
    --wdpsl-footer-bg: #212121;
    --wdpsl-btn-color: #e0e0e0;
    --wdpsl-btn-hover: #ffffff;
    --wdpsl-whatsapp-green: #25D366;
    --wdpsl-promo-red: #e53935;
}

/* --- Kontainer Utama & Popup --- */
.wdpsl-popup-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--wdpsl-bg-dark);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex; /* Menggunakan flexbox untuk layout utama */
    flex-direction: column; /* Menyusun header, body, footer secara vertikal */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.wdpsl-popup-container.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- Header --- */
.wdpsl-header {
    height: 64px; /* lebih tinggi agar kontrol perangkat tidak kepotong */
    background-color: var(--wdpsl-header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    flex-shrink: 0; /* Mencegah header menyusut */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.wdpsl-header-section { display: flex; align-items: center; flex: 1; }
.wdpsl-header-section.left { justify-content: flex-start; }
.wdpsl-header-section.center { justify-content: center; }
.wdpsl-header-section.right { justify-content: flex-end; }

/* --- Tombol & Ikon --- */
.wdpsl-device-controls { display: flex; gap: 10px; background-color: #212121; padding: 5px; border-radius: 8px; }
.wdpsl-device-button, 
.wdpsl-action-button {
    background: transparent;
    border: 2px solid transparent;
    color: var(--wdpsl-btn-color);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.wdpsl-device-button:hover { color: var(--wdpsl-btn-hover); background-color: #444; }
#wdpsl-whatsapp-btn:hover { background-color: var(--wdpsl-whatsapp-green); color: white; }
.wdpsl-device-button.active { color: var(--wdpsl-primary-color); border-color: var(--wdpsl-primary-color); background-color: rgba(124, 46, 201, 0.1); }
.wdpsl-svg-icon { width: 24px; height: 24px; fill: white; }
.wdpsl-close-button { font-size: 32px; color: var(--wdpsl-btn-color); background: none; border: none; cursor: pointer; padding: 0 10px; line-height: 1; transition: color 0.2s ease; }
.wdpsl-close-button:hover { color: var(--wdpsl-btn-hover); }

/* --- Body, Iframe & Preloader --- */
.wdpsl-body {
    flex-grow: 1; /* Membuat body mengisi sisa ruang */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px; /* kurangi padding agar preview lebih besar */
    overflow: hidden;
    box-sizing: border-box;
    background: transparent; /* pastikan tidak putih */
    position: relative; /* Diperlukan untuk preloader */
}
.wdpsl-preloader { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    z-index: 10; 
    display: none; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
    color: #fff; 
    font-family: sans-serif; 
    background: transparent; 
}
.wdpsl-preloader.visible { display: flex; }
.wdpsl-spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, 0.3); border-top-color: var(--wdpsl-primary-color); border-radius: 50%; animation: wdpsl-spin 1s linear infinite; }
.wdpsl-retry-button { background-color: #ff7043; color: #fff; padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; font-family: sans-serif; font-size: 14px; }
.wdpsl-retry-button:hover { background-color: #f4511e; }
.wdpsl-iframe-wrapper { 
    flex-shrink: 0; 
    transform-origin: center center; 
    transition: transform 0.35s ease, width 0.35s ease, height 0.35s ease, border-radius 0.35s ease; 
    box-shadow: 0 5px 25px rgba(0,0,0,0.3); 
    overflow: hidden; 
    pointer-events: none; 
}
#wdpsl-iframe { width: 100%; height: 100%; border: none; background-color: #fff; pointer-events: auto; }

/* --- Footer --- */
.wdpsl-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 15px;
    box-sizing: border-box;
    background-color: var(--wdpsl-footer-bg);
    flex-shrink: 0; /* Mencegah footer menyusut */
    border-top: 1px solid #444;
}
.wdpsl-footer-content { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; width: 100%; max-width: 720px; padding: 0; }
.wdpsl-ticker-wrap { 
    overflow: hidden; 
    color: #fff; 
    font-family: sans-serif; 
    font-size: 14px; 
    min-width: 0; 
    position: relative; 
    height: 20px; /* Memastikan tinggi cukup */
}
.wdpsl-ticker-text { 
    display: inline-block; 
    white-space: nowrap; 
    padding-right: 16px; 
    animation: wdpsl-ticker-scroll 2s linear infinite; 
    position: absolute; 
    left: 100%; 
    top: 50%; 
    transform: translateY(-50%);
}
#wdpsl-footer-btn { padding: 8px 16px; border-radius: 6px; text-decoration: none; font-family: sans-serif; font-weight: bold; font-size: 14px; transition: transform 0.2s ease; display: inline-flex; align-items: center; gap: 5px; }
#wdpsl-footer-btn:hover { transform: scale(1.05); }

/* --- Animasi & Lain-lain --- */
@keyframes wdpsl-ticker-scroll { 
    0% { transform: translate(0, -50%); } 
    100% { transform: translate(-200%, -50%); } 
}
@keyframes wdpsl-spin { to { transform: rotate(360deg); } }
body.wdpsl-no-scroll { overflow: hidden; }

/* --- Tampilan Responsif (Mobile) --- */
@media (max-width: 768px) {
    .wdpsl-header { height: 56px; }
    .wdpsl-device-controls { gap: 4px; padding: 3px; }
    .wdpsl-device-button, .wdpsl-action-button { padding: 4px 6px; }
    .wdpsl-svg-icon { width: 20px; height: 20px; fill: white !important; }
    .wdpsl-close-button { font-size: 26px; padding: 0 5px; }
    .wdpsl-footer-content { grid-template-columns: 1fr; gap: 10px; }
    /* Urutan mobile: ticker di atas, CTA di bawah (grid-row memastikan urutan) */
    .wdpsl-ticker-wrap { order: 1; grid-row: 1; }
    .wdpsl-footer-cta { order: 2; grid-row: 2; text-align: center; }
}