/* ==========================================================================
   ARWA POOLS — SERVICE DETAIL PAGES STYLESHEET
   Aesthetics: Premium, Framer-like, luxury layout with organic shapes
   ========================================================================== */

/* ── HERO SECTION ────────────────────────────────────────────────── */
.sd-hero {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: #0a1a1c;
}

.sd-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transform: scale(1.05);
}

.sd-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 26, 28, 0.4) 0%,
    rgba(10, 26, 28, 0.85) 100%
  );
  z-index: 1;
}

.sd-hero__content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 0 24px;
  margin-top: 80px;
}

.sd-hero__label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.35em;
  color: var(--aqua);
  text-transform: uppercase;
  margin-bottom: 20px;
  display: inline-block;
}

.sd-hero__title {
  font-family: var(--serif);
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: 300;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* ── INTRO SECTION ───────────────────────────────────────────────── */
.sd-intro-section {
  padding: 100px 0;
  background: var(--sand);
}

.sd-intro__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
}

.sd-intro__content {
  font-family: var(--serif);
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.45;
  color: var(--ink);
  font-weight: 300;
}

.sd-ideal-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px;
  border: 1px solid rgba(8, 89, 94, 0.08);
  box-shadow: 0 15px 40px rgba(8, 89, 94, 0.03);
}

/* Custom scroll reveal direction (slide in from right) */
.reveal.reveal-right {
  opacity: 0;
  transform: translateX(45px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.sd-ideal__title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--deep-teal);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sd-ideal__title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: rgba(8, 89, 94, 0.15);
}

.sd-ideal__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sd-ideal__item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  font-weight: 400;
}

.sd-ideal__icon {
  width: 8px;
  height: 8px;
  background: var(--pool-aqua);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── GALLERY SECTION ─────────────────────────────────────────────── */
.sd-gallery-section {
  padding: 100px 0;
  background: #fff;
}

.sd-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
}

.sd-gallery__item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.sd-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sd-gallery__item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(8, 89, 94, 0.15);
}

.sd-gallery__item:hover img {
  transform: scale(1.08);
}

/* ── PROCESS SECTION (3D FLIP CARDS DESIGN) ─────────────────────── */
.sd-process-section {
  padding: 80px 15px;
  background-color: #f9f9f9;
}

.sd-process__header {
  text-align: center;
  margin-bottom: 80px;
  padding: 0 24px;
}

.sd-process__subtitle {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--pool-aqua);
  margin-bottom: 12px;
  display: inline-block;
}

.sd-process__title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 300;
  color: var(--ink);
}

.sd-process__title em {
  font-style: italic;
  color: var(--deep-teal);
}

.sd-process__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 3D Flip Card Container & Engine */
.flip-card-container {
  perspective: 1200px;
  border-radius: 20px;
  background-color: transparent;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.flip-card-container:hover {
  transform: translateY(-8px);
}

.flip-card {
  position: relative;
  width: 100%;
  min-height: 370px;
  transform-style: preserve-3d;
  transition: transform 1.9s cubic-bezier(0.25, 1, 0.5, 1); /* smoother, slower premium 3d flip */
  border-radius: 30px;
}

/* Flip action on hover */
.flip-card-container:hover .flip-card {
  transform: rotateY(-180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d; /* CRITICAL: Enables 3D rendering for children */
  border-radius: inherit;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.4s ease;
}

.flip-card-container:hover .flip-card-front,
.flip-card-container:hover .flip-card-back {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Front Styling */
.flip-card-front {
  transform: rotateY(0deg);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dark Front Overlay */
.flip-card-front .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 1;
  border-radius: inherit; /* Clip overlay corners */
}

/* Back Styling */
.flip-card-back {
  transform: rotateY(180deg);
  background-color: #08595E; /* Branded deep teal button color */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inner content alignment (with depth transformation) */
.card-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translateZ(0px) scale(1);
  transform-style: preserve-3d; /* CRITICAL: allows grandchildren to pop */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-sizing: border-box;
  transition: transform 2.9s cubic-bezier(0.25, 1, 0.5, 1);
}

.flip-card-container:hover .card-inner {
  transform: translateZ(80px) scale(0.88); /* deep push-forward effect */
}

/* Backface visibility cleanup for 3D elements */
.card-inner,
.card-title,
.card-title-back,
.card-sub-title,
.card-number-back,
.card-desc,
.corner-line {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Titles and Typography */
.card-title {
  font-family: sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 10px 0;
  transform: translateZ(0px); /* 3D layer */
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 2.9s cubic-bezier(0.25, 1, 0.5, 1);

  /* Text Reflector (Shine animation) */
  background: linear-gradient(
    120deg,
    #ffffff 35%,
    #00C8C8 50%,
    #ffffff 65%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: reflectingShine 4s linear infinite;
  display: inline-block;
}

.flip-card-container:hover .card-title {
  transform: translateZ(40px);
}

.card-title-back {
  font-family: sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 15px 0;
  transform: translateZ(0px); /* 3D layer */
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 2.9s cubic-bezier(0.25, 1, 0.5, 1);
}

.flip-card-container:hover .card-title-back {
  transform: translateZ(45px);
}

.card-title-back a {
  text-decoration: none;
  color: #ffffff;
  
  /* Text Reflector (Shine animation) */
  background: linear-gradient(
    120deg,
    #ffffff 35%,
    #00C8C8 50%,
    #ffffff 65%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: reflectingShine 4s linear infinite;
  display: inline-block;
  transition: opacity 0.3s ease;
}

.card-title-back a:hover {
  opacity: 0.85;
}

.card-sub-title {
  font-family: sans-serif;
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 500;
  color: #00C8C8; /* Primary theme color */
  margin: 0 0 10px 0;
  transform: translateZ(0px); /* 3D layer */
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 2.9s cubic-bezier(0.25, 1, 0.5, 1);
}

.flip-card-container:hover .card-sub-title {
  transform: translateZ(30px);
}

.card-number-back {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 300;
  color: #00C8C8; /* Theme primary accent */
  margin-bottom: 20px;
  line-height: 1;
  transform: translateZ(0px); /* 3D layer */
  transition: transform 2.9s cubic-bezier(0.25, 1, 0.5, 1);
}

.flip-card-container:hover .card-number-back {
  transform: translateZ(50px);
}

.card-desc {
  font-family: sans-serif;
  font-size: 15px;
  color: #cccccc;
  line-height: 1.6;
  margin: 0;
  transform: translateZ(0px); /* 3D layer */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 2.9s cubic-bezier(0.25, 1, 0.5, 1);
}

.flip-card-container:hover .card-desc {
  transform: translateZ(35px);
}

/* Accent Corner Border Marks (Architectural Decoration) */
.corner-line {
  position: absolute;
  width: 45px;
  height: 45px;
  transform: translateZ(0px); /* 3D layer */
  transition: transform 2.9s cubic-bezier(0.25, 1, 0.5, 1);
}

.flip-card-container:hover .corner-line {
  transform: translateZ(15px);
}

.corner-line::before,
.corner-line::after {
  content: "";
  position: absolute;
  background-color: #1abc9c; /* Theme Primary Accent */
}

/* Top Left Corner lines */
.corner-tl {
  top: 30px;
  left: 30px;
}
.corner-tl::before {
  width: 1px;
  height: 100%;
  left: 10px;
  top: 0;
}
.corner-tl::after {
  height: 1px;
  width: 100%;
  left: 0;
  top: 10px;
}

/* Bottom Right Corner lines */
.corner-br {
  bottom: 30px;
  right: 30px;
}
.corner-br::before {
  width: 1px;
  height: 100%;
  right: 10px;
  top: 0;
}
.corner-br::after {
  height: 1px;
  width: 100%;
  right: 0;
  bottom: 10px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .sd-hero {
    height: 50vh;
    min-height: 380px;
  }
  .sd-intro__grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 0 24px;
  }
  .sd-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 24px;
    gap: 20px;
  }
  .sd-process__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 32px;
    padding: 0 24px;
  }
}

@media (max-width: 600px) {
  .sd-hero {
    height: 45vh;
    min-height: 340px;
  }
  .sd-hero__title {
    font-size: clamp(26px, 8vw, 38px);
  }
  .sd-intro-section {
    padding: 60px 0;
  }
  .sd-intro__grid {
    padding: 0 20px;
    gap: 32px;
  }
  .sd-intro__content {
    font-size: 20px;
    line-height: 1.4;
  }
  .sd-ideal-card {
    padding: 28px 20px;
    border-radius: 20px;
  }
  .sd-ideal__title {
    margin-bottom: 20px;
  }
  .sd-ideal__list {
    gap: 12px;
  }
  .sd-ideal__item {
    font-size: 14px;
  }
  
  .sd-gallery-section {
    padding: 60px 0;
  }
  .sd-gallery__grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 20px;
  }
  
  .sd-process-section {
    padding: 80px 0 60px;
  }
  .sd-process__header {
    margin-bottom: 56px;
  }
  .sd-process__grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 20px;
  }
}

/* ── CTA LAYOUT ─────────────────────────────────────────────────── */
.pf-cta {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 100px 40px;
}

.pf-cta__bg {
  position: absolute;
  inset: 0;
  background-image: url('../about/image-33.png');
  background-size: cover;
  background-position: center center;
  z-index: 0;
  filter: brightness(0.6) saturate(0.9);
}

.pf-cta__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.pf-cta__content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.pf-cta__accent-line {
  width: 48px; height: 3px;
  margin: 0 auto 24px;
  background: var(--aqua);
  border-radius: 2px;
}

.pf-cta__title {
  font-family: var(--serif);
  font-size: clamp(34px, 5.5vw, 70px);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.pf-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.pf-cta__btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.6);
  transform: scale(1.04);
}

.pf-cta__btn-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--aqua);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.pf-cta__btn:hover .pf-cta__btn-icon { transform: rotate(45deg); }

.pf-cta__featured {
  position: absolute;
  bottom: 20px;
  right: 28px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.pf-cta__featured strong { color: var(--aqua); }

@media (max-width: 600px) {
  .pf-cta {
    padding: 80px 20px;
    min-height: auto;
  }
  .pf-cta__title {
    font-size: clamp(28px, 8vw, 44px);
  }
  .pf-cta__btn-group {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 290px !important;
    margin: 28px auto 0 !important;
    gap: 12px !important;
  }
  .pf-cta__btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px 24px;
  }
  .pf-cta__featured {
    position: static;
    margin-top: 32px;
    text-align: center;
  }
}

/* ==========================================================================
   GLOBAL PEBBLE DESIGN BUTTON OVERRIDES
   ========================================================================== */

.btn,
.btn-quote,
.pf-cta__btn,
.pt-cta__btn,
.ps-cta__btn,
.pb-cta__btn,
.git-btn,
.con-submit-btn,
.pt-card__details-btn,
.ps-card__details-btn,
.pb-card__details-btn,
.pf-card__details-btn,
.proj-filter-btn,
.filter-btn,
.btn-solid {
  border-radius: 40px 15px 35px 15px / 15px 35px 15px 40px !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-radius 0.4s ease !important;
}

/* Morph shape on hover */
.btn:hover,
.btn-quote:hover,
.pf-cta__btn:hover,
.pt-cta__btn:hover,
.ps-cta__btn:hover,
.pb-cta__btn:hover,
.git-btn:hover,
.con-submit-btn:hover,
.pt-card__details-btn:hover,
.ps-card__details-btn:hover,
.pb-card__details-btn:hover,
.pf-card__details-btn:hover,
.proj-filter-btn:hover,
.filter-btn:hover,
.btn-solid:hover {
  border-radius: 15px 40px 15px 35px / 35px 15px 40px 15px !important;
}

@keyframes reflectingShine {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

/* ── VIDEO SECTION ─────────────────────────────── */
.sd-video-section {
  padding: 60px 32px 120px;
  background: #f9f9f9; /* Blend with process section background */
  display: flex;
  justify-content: center;
  position: relative;
}

.sd-video__container {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.sd-video__header {
  margin-bottom: 48px;
}

.sd-video__subtitle {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--pool-aqua, #00C8C8);
  margin-bottom: 16px;
  display: block;
}

.sd-video__title {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--ink, #0b1618);
}

.sd-video__title em {
  font-style: italic;
  color: var(--deep-teal, #08595E);
}

.sd-video__desc {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  color: rgba(11, 22, 24, 0.7);
  max-width: 620px;
  margin: 0 auto;
}

.sd-video__wrapper {
  position: relative;
  width: 100%;
  border-radius: 40px 16px 36px 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(8, 89, 94, 0.15); /* Soft, teal-tinted shadow instead of harsh dark */
  background: #000;
  border: 1px solid rgba(8, 89, 94, 0.08);
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.sd-video__wrapper::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(0, 200, 200, 0.15) 0%, transparent 75%);
  z-index: -1;
  filter: blur(25px);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.sd-video__wrapper:hover::before {
  opacity: 1;
}

.sd-video__element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Custom Play Overlay */
.sd-video__overlay-play {
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 24, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.sd-video__overlay-play.playing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sd-video__play-btn {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(8, 89, 94, 0.85);
  border: 1px solid rgba(0, 200, 200, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 200, 200, 0.3), 0 0 0 0 rgba(0, 200, 200, 0.2);
  transition: all 0.4s var(--ease-out);
  margin-bottom: 20px;
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 10px 30px rgba(0, 200, 200, 0.3), 0 0 0 0 rgba(0, 200, 200, 0.2);
  }
  70% {
    box-shadow: 0 10px 30px rgba(0, 200, 200, 0.3), 0 0 0 15px rgba(0, 200, 200, 0);
  }
  100% {
    box-shadow: 0 10px 30px rgba(0, 200, 200, 0.3), 0 0 0 0 rgba(0, 200, 200, 0.2);
  }
}

.sd-video__play-btn svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  transform: translateX(2px);
  transition: fill 0.3s ease, transform 0.3s ease;
}

.sd-video__play-btn:hover {
  transform: scale(1.08);
  background: #ffffff;
  border-color: #ffffff;
  color: #0d1117;
}

.sd-video__play-btn:hover svg {
  fill: #0d1117;
  transform: translateX(2px) scale(1.05);
}

.sd-video__play-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0.9;
  transition: color 0.3s ease;
}

.sd-video__wrapper:hover .sd-video__play-label {
  color: #00C8C8;
}

@media (max-width: 768px) {
  .sd-video-section {
    padding: 50px 24px 80px;
  }
  .sd-video__header {
    margin-bottom: 36px;
  }
  .sd-video__play-btn {
    width: 72px;
    height: 72px;
  }
  .sd-video__play-btn svg {
    width: 22px;
    height: 22px;
  }
}
