/* ==========================================================================
   SoukAds — Custom Editorial Design System & Micro-Interactions
   ========================================================================== */

:root {
  --bg-canvas: #F8F9FC;
  --surface-card: #FFFFFF;
  --border-bento: rgba(30, 42, 120, 0.08);
  --brand-royal: #1E2A78;
  --brand-orange-start: #FF7A00;
  --brand-orange-end: #E63900;
  --brand-gradient: linear-gradient(135deg, #FF7A00 0%, #E63900 100%);
  --text-primary: #0F172A;
  --text-muted: #475569;
  --accent-whatsapp: #16A34A;
}

/* Prevent horizontal scroll on all mobile viewports */
html,
body {
  max-width: 100%;
  overflow-x: clip;
  font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Arabic typography clarity: keep letter-spacing natural so connected glyphs stay crisp */
h1, h2, h3, h4, p, span, a, button {
  letter-spacing: 0;
}

/* ==========================================================================
   Hero Architectural Studio Backdrop
   ========================================================================== */
.hero-backdrop {
  background-image:
    radial-gradient(60% 45% at 50% 0%, rgba(30, 42, 120, 0.065) 0%, rgba(30, 42, 120, 0) 70%),
    radial-gradient(45% 35% at 15% 15%, rgba(255, 122, 0, 0.06) 0%, rgba(255, 122, 0, 0) 65%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.75) 0%, rgba(248, 249, 252, 0) 100%);
}

/* ==========================================================================
   Brand Gradient Utilities
   ========================================================================== */
.btn-gradient {
  background-image: var(--brand-gradient);
  position: relative;
  transition: transform 200ms ease, box-shadow 220ms ease, filter 200ms ease;
}

.btn-gradient:hover {
  filter: brightness(1.04);
  box-shadow: 0 14px 30px -10px rgba(230, 57, 0, 0.52);
  transform: translateY(-1px);
}

.btn-gradient:active {
  transform: translateY(0) scale(0.985);
}

.gradient-text {
  background-image: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Apple-Inspired Bento Cards
   ========================================================================== */
.bento-card {
  border: 1px solid var(--border-bento);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.035),
    0 12px 32px -14px rgba(30, 42, 120, 0.08);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 260ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 260ms ease;
}

@media (hover: hover) {
  .bento-card:hover {
    border-color: rgba(30, 42, 120, 0.14);
    box-shadow:
      0 4px 12px rgba(15, 23, 42, 0.045),
      0 22px 44px -18px rgba(30, 42, 120, 0.13);
  }
}

.offer-featured {
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .offer-featured:hover {
    box-shadow:
      0 4px 12px rgba(255, 122, 0, 0.12),
      0 28px 54px -18px rgba(255, 122, 0, 0.24);
  }
}

/* ==========================================================================
   Offer Video Showcase Frame & Fallback Preview
   ========================================================================== */
.offer-video-shell {
  isolation: isolate;
}

.offer-video {
  transition: opacity 320ms ease;
}

.video-fallback {
  background:
    radial-gradient(circle at 20% 20%, rgba(45, 60, 155, 0.55) 0%, transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255, 122, 0, 0.2) 0%, transparent 55%),
    linear-gradient(155deg, #101742 0%, #182362 52%, #0F172A 100%);
  transition: opacity 350ms ease, visibility 350ms ease;
}

.video-fallback--featured {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 122, 0, 0.32) 0%, transparent 55%),
    radial-gradient(circle at 82% 82%, rgba(30, 42, 120, 0.7) 0%, transparent 55%),
    linear-gradient(155deg, #161C48 0%, #1E2A78 52%, #111827 100%);
}

.video-fallback.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Subtle ambient sweep animation on fallback frame */
.video-fallback-glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 90deg at 50% 50%,
    rgba(255, 255, 255, 0) 0deg,
    rgba(255, 255, 255, 0.06) 60deg,
    rgba(255, 122, 0, 0.08) 120deg,
    rgba(255, 255, 255, 0) 180deg
  );
  animation: slowSpin 16s linear infinite;
  pointer-events: none;
}

.video-fallback-glow--warm {
  background: conic-gradient(
    from 90deg at 50% 50%,
    rgba(255, 255, 255, 0) 0deg,
    rgba(255, 122, 0, 0.14) 70deg,
    rgba(230, 57, 0, 0.12) 130deg,
    rgba(255, 255, 255, 0) 190deg
  );
}

@keyframes slowSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   FAQ Smooth Accordion (CSS Grid Row Animation)
   ========================================================================== */
.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-content.is-open {
  grid-template-rows: 1fr;
}

.faq-content-inner {
  overflow: hidden;
}

.faq-trigger[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
  background-color: #EEF1FA;
  border-color: rgba(30, 42, 120, 0.18);
}

/* ==========================================================================
   Scroll-Reveal Subtle Fade-Up
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 550ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Mobile Sticky Bottom CTA Bar
   ========================================================================== */
.mobile-sticky-bar {
  opacity: 0;
  transform: translateY(110%);
  pointer-events: none;
  transition: opacity 280ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-sticky-bar.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   Floating Bottom-Right WhatsApp Button
   ========================================================================== */
.floating-wa-btn {
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transition: bottom 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Shift gently above the mobile sticky CTA bar when visible on small screens */
@media (max-width: 767px) {
  .floating-wa-btn.above-sticky-bar {
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }
}

@media (min-width: 768px) {
  .floating-wa-btn {
    bottom: 1.5rem;
  }
}

.floating-wa-pulse {
  animation: waPulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes waPulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.38);
    opacity: 0;
  }
  100% {
    transform: scale(1.38);
    opacity: 0;
  }
}

/* ==========================================================================
   Reduced Motion Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .video-fallback-glow,
  .floating-wa-pulse {
    animation: none;
  }

  .faq-content,
  .mobile-sticky-bar,
  .floating-wa-btn,
  .bento-card,
  .btn-gradient {
    transition: none;
  }
}
