/* Exit-Intent Premium Iframe Popup Styles */
:root {
  --popup-primary: var(--wp--preset--color--primary, #1467CF);
  --popup-accent: var(--wp--preset--color--accent, #538EFF);
  --popup-dark: var(--wp--preset--color--dark, #0A0F1A);
  --popup-surface: var(--wp--preset--color--surface, #FFFFFF);
  --popup-surface-soft: var(--wp--preset--color--surface-soft, #F4F6FB);
  --popup-ink: var(--wp--preset--color--ink, #0A0F1A);
  --popup-ink-soft: var(--wp--preset--color--ink-soft, #1E293B);
  --popup-muted: var(--wp--preset--color--muted, #4A5568);
  --popup-border: var(--wp--preset--color--border, #E2E8F0);
  /* Pyzen Dark Gradient */
  --popup-gradient: var(--wp--preset--gradient--pyzen-dark, linear-gradient(135deg, #030712 0%, #0B1120 52%, #1467CF 100%));
}

/* Modal Overlay */
.appi-exit-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 26, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  padding: 20px;
}

.appi-exit-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.appi-exit-modal-wrapper {
  background: var(--popup-surface);
  border-radius: 24px;
  width: 100%;
  max-width: 1000px;
  height: 680px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--wp--preset--font-family--montserrat, "Montserrat", sans-serif);
}

.appi-exit-modal-wrapper * {
  box-sizing: border-box;
}

.appi-exit-modal-backdrop.is-active .appi-exit-modal-wrapper {
  transform: scale(1) translateY(0);
}

/* Flex layout helper classes */
.fdc { display: flex; flex-direction: column; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.gap16 { gap: 16px; }
.gap24 { gap: 24px; }
.dp-flex { display: flex; }
.flex-center { align-items: center; }
.justify-space-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.wht-text { color: #FFFFFF !important; }
.weight500 { font-weight: 500; }
.weight600 { font-weight: 600; }
.mb0 { margin-bottom: 0 !important; }
.m0 { margin: 0 !important; }

/* Left Column - Abstract Gradient & Testimonials */
.appi-exit-modal-left {
  flex: 0 0 55%;
  min-width: 0;
  background: var(--popup-gradient);
  padding: 40px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Background light orb details for extra premium look */
.appi-exit-modal-left::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(20, 103, 207, 0.25) 0%, rgba(20, 103, 207, 0) 70%);
  pointer-events: none;
}

.appi-exit-modal-left::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(83, 142, 255, 0.15) 0%, rgba(83, 142, 255, 0) 70%);
  pointer-events: none;
}

.appi-left-header .title-h4 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: #FFFFFF;
  margin: 0;
}

.appi-left-header .fs-para {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

/* Glassmorphic Testimonial Card */
.appi-testimonial-glass-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.client-quote {
  color: var(--popup-accent);
  opacity: 0.4;
  margin-bottom: 8px;
}

.client-carousel-wrapper {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  align-items: center;
}

.client-slide {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.client-slide.is-active {
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
}

.client-slider-text {
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-style: italic !important;
  margin: 0 0 16px 0 !important;
}

/* Profile details */
.client-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--popup-primary) 0%, var(--popup-accent) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.client-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
}

.client-designation {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Inline Testimonial Card Prev/Next arrows at the bottom right of the card */
.client-testimonial-nav {
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
}

.client-testimonial-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FFFFFF;
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.client-testimonial-nav-btn:hover {
  background: var(--popup-accent);
  border-color: var(--popup-accent);
  transform: scale(1.05);
}

.client-testimonial-nav-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Trust Badges / Awards Section */
.appi-modal-awards {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  margin-top: 12px;
}

.award-modal-title {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  display: block;
}

.modal-awards-content {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* White logo tile wrapper to contain any brand logo style */
.exit-logo-tile {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  height: 46px;
  padding: 5px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

/* Larger logo tile for enqueued awards badges */
.exit-logo-tile-award {
  height: 58px !important;
  padding: 8px 22px !important;
  border-radius: 8px !important;
}

.exit-logo-tile-award img {
  height: 38px !important;
  max-width: 120px !important;
}

.exit-logo-tile:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.exit-logo-tile img {
  height: 28px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  display: block;
  filter: none !important; /* Preserve original logo colors & background */
}

/* Text fallback inside the logo tile if image fails */
.logo-tile-text-fallback {
  font-size: 0.65rem;
  font-weight: 700;
  color: #1E293B;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Client Logo Marquee */
.appi-modal-clients-marquee {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.exit-marquee-container {
  overflow: hidden;
  width: 100%;
  margin-top: 10px;
  position: relative;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.exit-marquee-track {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: exitMarqueeScroll 25s linear infinite;
  padding: 4px 0;
}

.exit-marquee-track-reverse {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: exitMarqueeScrollReverse 25s linear infinite;
  padding: 4px 0;
}

.exit-marquee-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@keyframes exitMarqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes exitMarqueeScrollReverse {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Right Column - Form / Iframe Wrapper */
.appi-exit-modal-form-wrapper {
  flex: 0 0 45%;
  min-width: 0;
  background: var(--popup-surface);
  padding: 40px 30px 30px 30px;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Close Button styling */
.exit-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.3s ease;
}

.exit-modal-close:hover {
  transform: rotate(90deg) scale(1.1);
}

.exit-modal-close svg {
  width: 28px;
  height: 28px;
}

/* Iframe Frame Sizing */
.pyzen-exit-iframe-container {
  width: 100%;
  height: 100%;
  overflow: hidden; /* No scrollbar on desktop */
  border-radius: 8px;
  border: none;
}

.pyzen-exit-popup-iframe {
  width: 100%;
  height: 100%; /* Fill container dynamically */
  border: none;
  display: block;
}

/* Hide mobile-only elements on desktop viewports */
.mobile-only-header,
.mobile-only-marquee {
  display: none !important;
}

/* Mobile Responsiveness (Under 768px) */
@media (max-width: 767px) {
  .appi-exit-modal-backdrop {
    padding: 12px;
  }

  .appi-exit-modal-wrapper {
    flex-direction: column;
    max-width: 480px;
    height: 90vh;
    max-height: 640px;
    border-radius: 20px;
    background: var(--popup-gradient);
  }

  /* Hide left testimonial panel completely on mobile */
  .appi-exit-modal-left {
    display: none !important;
  }

  /* Right Panel Form wrapper expands to full width and gets dark gradient styling */
  .appi-exit-modal-form-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 24px 16px 16px 16px;
    background: var(--popup-gradient) !important;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .exit-modal-close {
    top: 12px;
    right: 12px;
  }

  /* Mobile-only header display styling */
  .mobile-only-header {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding-right: 28px; /* Ensure space for close button */
    text-align: left;
  }

  .mobile-only-header .title-h4 {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
    color: #FFFFFF !important;
    margin: 0;
  }

  .mobile-only-header .fs-para {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75) !important;
    line-height: 1.4;
  }

  /* Iframe Container sizing on mobile to fit the viewport vertically */
  .pyzen-exit-iframe-container {
    height: 380px !important;
    overflow-y: auto !important; /* Enable scroll on mobile viewports */
    -webkit-overflow-scrolling: touch;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  }

  .pyzen-exit-popup-iframe {
    height: 750px; /* Fixed height for scrolling within the mobile container */
  }

  /* Mobile-only client logo marquee display styling */
  .mobile-only-marquee {
    display: block !important;
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
    width: 100%;
  }

  .mobile-only-marquee .modal-awards-header {
    margin-bottom: 6px;
  }

  .mobile-only-marquee .award-modal-title {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    display: block;
  }

  /* Shrink tiles slightly for mobile marquee */
  .mobile-only-marquee .exit-logo-tile {
    height: 34px !important;
    padding: 3px 10px !important;
  }

  .mobile-only-marquee .exit-logo-tile img {
    height: 18px !important;
  }
}
