/* ==========================================================================
   OASIS POOL SERVICES — Services Page Stylesheet
   Hero base, hero modifier, service detail, process timeline, video wrap
   ========================================================================== */

/* --------------------------------------------------------------------------
   HERO BASE (shared structure used by services hero)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--color-primary);
  overflow: hidden;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero__video--active {
  opacity: 1;
}

.hero__poster {
  position: absolute;
  inset: 0;
  background: url('../assets/hero-pool.jpg') center / cover no-repeat;
  z-index: 0;
  display: none;
}

.hero__bg-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(160deg, rgba(12, 35, 64, 0.82) 0%, rgba(15, 45, 79, 0.6) 40%, rgba(10, 30, 56, 0.45) 100%),
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(0, 180, 216, 0.1), transparent),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(255, 107, 44, 0.05), transparent);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero__video {
    display: none;
  }
  .hero__poster {
    display: block;
  }
}

.hero__content {
  position: relative;
  z-index: 2;
  padding-top: 8rem;
  padding-bottom: 4rem;
}

.hero__heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.08;
  color: var(--color-white);
  max-width: 740px;
  margin-bottom: 1.5rem;
}

.hero__sub {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .hero__content {
    max-width: 55%;
  }
}

/* Hero modifier for services (reuses .hero component) */
.hero--services {
  min-height: 60vh;
  display: flex;
  align-items: center;
  text-align: center;
}

.hero--services .hero__content {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 8rem;
  padding-bottom: 3rem;
}

.hero--services .hero__heading {
  max-width: 100%;
}

.hero--services .hero__sub {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* Service Detail (alternating image+text) */
.service-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.service-detail--reverse .service-detail__image {
  order: -1;
}

.service-detail__image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.12), rgba(12, 35, 64, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
  min-height: 320px;
}

/* Service Video Playlist (crossfade) */
.service-video-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.service-video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.service-video-wrap video.active {
  opacity: 1;
}

.service-detail__content {
  max-width: 560px;
}

.service-detail__desc {
  font-size: 1.05rem;
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.service-detail__features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.service-detail__feature {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}

.service-detail__feature svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--color-secondary);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 1024px) {
  .service-detail {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }

  .service-detail--reverse {
    direction: rtl;
  }

  .service-detail--reverse > * {
    direction: ltr;
  }
}

@media (max-width: 640px) {
  .service-detail__features {
    grid-template-columns: 1fr;
  }
}

/* Process / Timeline */
.process__timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.process__step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  position: relative;
}

.process__step-number {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-secondary), rgba(0, 180, 216, 0.7));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-white);
  position: relative;
  z-index: 2;
}

.process__step-icon {
  width: 28px;
  height: 28px;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.process__step-content {
  padding-top: 0.5rem;
}

.process__step-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.process__step-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
}

/* Timeline duration bar */
.process__duration {
  margin-top: 3rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.process__duration-line {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.process__duration-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-cta));
  border-radius: 3px;
  animation: durationFill 2s ease-out forwards;
  transform-origin: left;
}

@keyframes durationFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.process__duration-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.process__duration-start,
.process__duration-end {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-secondary);
  white-space: nowrap;
}

.process__duration-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  flex: 1;
  padding: 0 1rem;
}

@media (max-width: 480px) {
  .process__duration-text {
    font-size: 0.78rem;
    padding: 0 0.5rem;
  }
  .process__duration-start,
  .process__duration-end {
    font-size: 0.75rem;
  }
}

/* Vertical connector line (mobile) */
.process__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 64px;
  left: 32px;
  transform: translateX(-50%);
  width: 2px;
  height: calc(100% + 3rem - 64px);
  background: linear-gradient(180deg, var(--color-secondary), rgba(0, 180, 216, 0.2));
  z-index: 1;
}

/* Desktop: horizontal layout */
@media (min-width: 768px) {
  .process__timeline {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .process__step {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .process__step-content {
    padding-top: 0;
  }

  .process__step:not(:last-child)::after {
    top: 32px;
    left: calc(50% + 40px);
    width: calc(100% - 16px);
    height: 2px;
    transform: none;
    background: linear-gradient(90deg, var(--color-secondary), rgba(0, 180, 216, 0.2));
  }
}
