/* =========================================
   واحة الابتسامة — Main Stylesheet
   ========================================= */

html {
  scroll-behavior: smooth;
  background-color: #f8fafc;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family:
    "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Tahoma, sans-serif;
  overscroll-behavior-y: none;
  /* Smoother text rendering without heavy AA on mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

/* Offset anchor scroll for fixed header */
section[id] {
  scroll-margin-top: 6rem;
}

/* Client avatars (inline SVG) */
.avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  border: 3px solid #f4f7f9;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================
   Soft background blobs
   --------------------------------------------------
   NOTE: Previously used `filter: blur(200px)` which is
   extremely expensive on Safari (iOS & macOS) — it forces
   a huge GPU texture + convolution every paint, causing
   a very slow first render especially on mobile.
   Replaced with radial-gradients (near-zero GPU cost).
   ========================================= */
.blob {
  position: fixed;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  will-change: auto;
}
.blob-1 {
  width: 900px;
  height: 900px;
  top: -250px;
  left: -250px;
  background: radial-gradient(
    circle at center,
    rgba(2, 200, 192, 0.10) 0%,
    rgba(2, 200, 192, 0.05) 35%,
    rgba(2, 200, 192, 0) 70%
  );
}
.blob-2 {
  width: 1000px;
  height: 1000px;
  bottom: -350px;
  right: -350px;
  background: radial-gradient(
    circle at center,
    rgba(2, 200, 192, 0.10) 0%,
    rgba(2, 200, 192, 0.05) 35%,
    rgba(2, 200, 192, 0) 70%
  );
}

/* Header transition — lighter blur for Safari performance */
#header {
  position: fixed;
  /* Promote to its own layer so it doesn't trigger repaint of the whole page */
  transform: translateZ(0);
  backface-visibility: hidden;
}
#header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.92);
  /* Reduced from 14px → 8px: visually similar, much cheaper on Safari */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px -6px rgba(0, 0, 0, 0.08);
  opacity: 0;
  /* Only pay the backdrop-filter cost when visible */
  visibility: hidden;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
  pointer-events: none;
  z-index: -1;
}
#header.header-scrolled::before {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0s;
}

/* Hide scrollbar for carousel but keep functionality */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Details accordion animation */
details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}

/* FAQ active state */
details {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
details[open] {
  background-color: #ffffff !important;
  border-color: rgba(2, 200, 192, 0.35) !important;
  box-shadow: 0 10px 30px -10px rgba(2, 200, 192, 0.2);
}
details[open] > summary {
  color: #02c8c0 !important;
}
details[open] > summary > span:last-child {
  background-color: #02c8c0 !important;
  box-shadow: 0 6px 14px -4px rgba(2, 200, 192, 0.5);
}
details[open] > summary > span:last-child i {
  color: #ffffff !important;
}

/* =========================================
   Performance: skip offscreen work on below-the-fold sections.
   Browsers that don't support content-visibility simply ignore it.
   ========================================= */
@supports (content-visibility: auto) {
  #services,
  #testimonials,
  #cases,
  #booking,
  footer {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
