/**
 * Dual-Action section: Audience Switcher (Tabs) + App Download Showcase
 * Bright & clean theme. Stripe/Haat light mode style. RTL-friendly. Mobile-first.
 */

.dual-action {
  --da-bg: #ffffff;
  --da-bg-soft: #f9fafb;
  --da-brand: var(--primary-red, #ff6b00);
  --da-text: var(--text-dark, #1a1a1a);
  --da-text-muted: var(--text-grey, #555555);
  --da-tab-inactive-bg: #e5e7eb;
  --da-tab-inactive-text: #374151;
  --da-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --da-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --da-radius: 9999px;
  --da-radius-card: 16px;
  --da-blob-color-1: rgba(59, 130, 246, 0.25);
  --da-blob-color-2: rgba(6, 182, 212, 0.2);

  background: var(--da-bg);
  padding: clamp(2.5rem, 8vw, 4.5rem) 0;
  position: relative;
}

.dual-action__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

/* ----- Part A: Audience Switcher ----- */
.audience-switcher {
  margin-bottom: clamp(3rem, 10vw, 5rem);
}

/* Tabs: horizontal scroll strip on mobile, centered on desktop */
.audience-switcher__tabs-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
  -webkit-overflow-scrolling: touch;
}

.audience-switcher__tabs {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.35rem;
  background: var(--da-bg-soft);
  border-radius: var(--da-radius);
  box-shadow: var(--da-shadow);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 100%;
}

.audience-switcher__tabs::-webkit-scrollbar {
  display: none;
}

.audience-tab {
  flex-shrink: 0;
  scroll-snap-align: center;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--da-radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--da-tab-inactive-text);
  background: transparent;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.audience-tab .material-symbols-rounded {
  font-size: 1.35rem;
}

.audience-tab:hover {
  background: #d1d5db;
  color: var(--da-text);
}

.audience-tab--active {
  background: var(--da-brand);
  color: #ffffff;
}

.audience-tab--active:hover {
  background: var(--da-brand);
  color: #ffffff;
  filter: brightness(1.05);
}

/* Dynamic content panels */
.audience-content {
  position: relative;
  min-height: 200px;
}

.audience-panel {
  display: none;
  animation: daFadeIn 0.35s ease;
}

.audience-panel--active {
  display: block;
}

@keyframes daFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Content row: text + image. RTL: text on right, image on left (flex direction handles it) */
.dual-content {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: stretch;
}

[dir="rtl"] .dual-content {
  direction: rtl;
}

.dual-content__media {
  order: -1;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

/* Legacy placeholder – kept as fallback background */
.dual-content__placeholder {
  aspect-ratio: 4 / 3;
  border-radius: var(--da-radius-card);
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  box-shadow: var(--da-shadow-md);
}

/* Real images inside dual-action media panels */
.dual-content__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: var(--da-radius-card);
  box-shadow: var(--da-shadow-md);
}

.dual-content__text {
  text-align: center;
}

.dual-content__headline {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  color: var(--da-text);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.dual-content__body {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--da-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 520px;
  margin-inline: auto;
}

.dual-content__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--da-brand);
  transition:
    color 0.2s ease,
    gap 0.2s ease;
}

.dual-content__cta:hover {
  color: var(--da-brand);
  gap: 0.5rem;
}

.dual-content__cta .cta-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

[dir="rtl"] .dual-content__cta .cta-arrow {
  transform: scaleX(-1);
}

.dual-content__cta:hover .cta-arrow {
  transform: translateX(4px);
}

[dir="rtl"] .dual-content__cta:hover .cta-arrow {
  transform: scaleX(-1) translateX(4px);
}

/* Desktop: text and image side by side */
@media (min-width: 768px) {
  .dual-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: clamp(2rem, 5vw, 3rem);
  }

  .dual-content__media {
    order: 0;
    flex: 0 0 42%;
    max-width: 42%;
    margin-inline: 0;
  }

  .dual-content__text {
    flex: 1;
    min-width: 0;
    text-align: start;
  }

  .dual-content__body {
    margin-inline: 0;
  }

  [dir="rtl"] .dual-content {
    flex-direction: row-reverse;
  }
}

/* ----- Part B: App Showcase ----- */
.app-showcase {
  position: relative;
  background: var(--da-bg-soft);
  border-radius: 24px;
  padding: clamp(2rem, 6vw, 3.5rem) 5%;
  overflow: hidden;
}

/* Soft gradient blob behind phone */
.app-showcase__blob {
  position: absolute;
  width: min(80vw, 420px);
  height: min(80vw, 420px);
  max-width: 420px;
  max-height: 420px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    var(--da-blob-color-1) 0%,
    var(--da-blob-color-2) 40%,
    transparent 70%
  );
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}

.app-showcase__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.app-showcase__phone-wrap {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

/* Floating animation for phone */
.app-showcase__phone {
  aspect-ratio: 9 / 19;
  border-radius: 28px;
  background: linear-gradient(145deg, #e5e7eb 0%, #d1d5db 50%, #9ca3af 100%);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  animation: daFloat 5s ease-in-out infinite;
}

@keyframes daFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.app-showcase__copy {
  max-width: 480px;
}

.app-showcase__headline {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--da-text);
  line-height: 1.25;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.app-showcase__subhead {
  font-size: 1rem;
  color: var(--da-text-muted);
  margin-bottom: 1.5rem;
}

.app-showcase__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.app-showcase__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--da-text);
  background: var(--da-bg);
  box-shadow: var(--da-shadow-md);
  transition:
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.app-showcase__btn:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.app-showcase__btn-placeholder {
  color: var(--da-text-muted);
}

/* Desktop: split layout option (phone and copy side by side) */
@media (min-width: 768px) {
  .app-showcase__content {
    flex-direction: row;
    justify-content: center;
    text-align: start;
    gap: clamp(2rem, 5vw, 3rem);
  }

  .app-showcase__phone-wrap {
    flex-shrink: 0;
    max-width: 260px;
    margin: 0;
  }

  .app-showcase__copy {
    max-width: 400px;
  }

  .app-showcase__buttons {
    justify-content: flex-start;
  }

  [dir="rtl"] .app-showcase__content {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .app-showcase__buttons {
    justify-content: flex-end;
  }
}

/* Image placeholders (global within section – legacy fallback) */
.dual-action .img-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
