/* WDP Showlink Lite - Frontend styles */
:root {
  --wdpsl-topbar-h: 56px;
  --wdpsl-footer-h: 48px;
  --wdpsl-accent: #7c3aed; /* purple */
  --wdpsl-bg: rgba(0,0,0,.72);
}

body.wdpsl-open {
  overflow: hidden !important;
}

.wdpsl-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  background: var(--wdpsl-bg);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Try to isolate the popup from theme styles (Elementor/themes often style buttons & svg). */
.wdpsl-overlay,
.wdpsl-overlay * {
  box-sizing: border-box !important;
}

.wdpsl-overlay svg {
  display: block;
}

.wdpsl-overlay.wdpsl-hidden {
  display: none;
}

.wdpsl-topbar {
  height: calc(var(--wdpsl-topbar-h) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: rgba(26,26,26,.92);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset;
}

.wdpsl-topbar .wdpsl-left,
.wdpsl-topbar .wdpsl-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wdpsl-topbar .wdpsl-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Reset and restyle our own buttons so theme styles don't leak in */
.wdpsl-overlay button.wdpsl-btn-icon,
.wdpsl-overlay a.wdpsl-btn-icon {
  all: unset;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1;
  user-select: none;
  position: relative;
  overflow: visible;
}


.wdpsl-btn-icon svg {
  width: 18px;
  height: 18px;
}

/* Force device icons to render even if theme sets svg/path fill to none */
.wdpsl-device svg path {
  fill: currentColor !important;
}

.wdpsl-btn-icon:hover {
  background: rgba(255,255,255,.10);
}

.wdpsl-btn-icon:focus {
  outline: 2px solid rgba(124,58,237,.7);
  outline-offset: 2px;
}



.wdpsl-overlay button.wdpsl-btn-icon,
.wdpsl-overlay a.wdpsl-btn-icon,
.wdpsl-overlay button.wdpsl-close,
.wdpsl-footer-cta {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.wdpsl-btn-icon.wdpsl-active {
  border-color: var(--wdpsl-accent);
  background: rgba(124,58,237,.18);
  color: var(--wdpsl-accent);
  box-shadow: 0 0 0 2px rgba(124,58,237,.22) inset;
}
.wdpsl-btn-icon.wdpsl-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--wdpsl-accent);
  box-shadow: 0 0 0 2px rgba(0,0,0,.35);
}


.wdpsl-device-group {
  display: inline-flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.12);
}

/* WhatsApp button style closer to the reference (round) */
.wdpsl-wa {
  border-radius: 999px !important;
  padding: 0 !important;
  width: 36px;
  min-width: 36px;
  height: 36px;
}

.wdpsl-wa svg {
  width: 20px;
  height: 20px;
}

/* Close button: minimal like the reference */
.wdpsl-overlay button.wdpsl-close {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  opacity: .88;
}

.wdpsl-overlay button.wdpsl-close:hover {
  opacity: 1;
}

.wdpsl-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 14px 14px 8px 14px;
}

.wdpsl-frame-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
}

.wdpsl-frame {
  position: relative;
  width: var(--wdpsl-frame-w, 1200px);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}



.wdpsl-overlay[data-wdpsl-view="full"] .wdpsl-body {
  padding: 0;
}

.wdpsl-overlay[data-wdpsl-view="full"] .wdpsl-iframe {
  border-radius: 0;
}

.wdpsl-overlay[data-wdpsl-view="full"] .wdpsl-frame {
  width: 100%;
  height: 100%;
  border-radius: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.wdpsl-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  border-radius: 8px;
  display: block;
  transition: transform .18s ease, margin .18s ease;
}

.wdpsl-spinner {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.wdpsl-frame.wdpsl-loading .wdpsl-spinner {
  display: flex;
}

.wdpsl-footer {
  height: calc(var(--wdpsl-footer-h) + env(safe-area-inset-bottom));
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 14px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(26,26,26,.94);
  color: #fff;
  box-shadow: 0 -1px 0 rgba(255,255,255,.08) inset;
}

.wdpsl-footer.wdpsl-show {
  display: flex;
}

.wdpsl-footer-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  opacity: .92;
  text-align: center;
}

.wdpsl-footer-text .wdpsl-marquee {
  display: inline-block;
  padding-left: 100%;
  animation: wdpsl-marquee var(--wdpsl-ticker-duration, 18s) linear infinite;
}

@keyframes wdpsl-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.wdpsl-footer-cta {
  all: unset;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  color: var(--wdpsl-footer-btn-color, #fff);
  background: var(--wdpsl-footer-btn-bg, #ef4444);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wdpsl-footer-cta:hover {
  filter: brightness(1.02);
}

/* Viewer placeholder */
.wdpsl-viewer {
  padding: 18px;
  background: rgba(0,0,0,.04);
  border: 1px dashed rgba(0,0,0,.12);
  border-radius: 10px;
}

.wdpsl-viewer-hint {
  color: rgba(0,0,0,.7);
}

.wdpsl-viewer-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  border-radius: 8px;
}

.wdpsl-viewer-ok {
  margin-top: 10px;
  padding: 10px 12px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  border-radius: 8px;
}


/* Mobile tweaks */
@media (max-width: 640px) {
  :root {
    --wdpsl-topbar-h: 52px;
    --wdpsl-footer-h: 56px;
  }

  .wdpsl-topbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .wdpsl-topbar .wdpsl-left,
  .wdpsl-topbar .wdpsl-right {
    gap: 8px;
  }

  .wdpsl-device-group {
    gap: 6px;
    padding: 6px 8px;
    max-width: calc(100vw - 120px);
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .wdpsl-device-group::-webkit-scrollbar {
    display: none;
  }

  .wdpsl-overlay button.wdpsl-btn-icon,
  .wdpsl-overlay a.wdpsl-btn-icon {
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    border-radius: 10px;
  }

  .wdpsl-wa {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .wdpsl-overlay button.wdpsl-close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .wdpsl-body {
    padding: 10px 10px 8px 10px;
  }

  .wdpsl-frame {
    padding: 8px;
    border-radius: 12px;
  }

  .wdpsl-footer {
    padding-left: 10px;
    padding-right: 10px;
    gap: 10px;
  }

  .wdpsl-footer-text {
    font-size: 13px;
  }

  .wdpsl-footer-cta {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
  }

  /* On phones, make the "Mobile" device preview feel more like a real full-screen view */
  .wdpsl-overlay[data-wdpsl-view="mobile"] .wdpsl-body {
    padding: 12px 12px 10px 12px;
  }
  .wdpsl-overlay[data-wdpsl-view="mobile"] .wdpsl-frame {
    width: 100%;
    max-width: 520px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.07);
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
  }
  .wdpsl-overlay[data-wdpsl-view="mobile"] .wdpsl-iframe {
    border-radius: 12px;
  }
}

@media (max-width: 420px) {
  /* Stack footer on very small phones so CTA remains tappable */
  .wdpsl-footer {
    flex-direction: column;
    height: auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .wdpsl-footer-text {
    width: 100%;
    text-align: center;
  }

  .wdpsl-footer-cta {
    width: 100%;
  }
}
