/* ============================================================================
   Search loading overlay - new design, ported from:
   F:\CyprusParadise-NewDesigns\prototypes\search-results\ (assets/ui/wait-card.css +
   assets/ui/package-line.css, the #search-loader / "wait" card shown while a search is
   in flight).

   Scope: ONLY _SearchResultsLoading.cshtml. Everything here is namespaced under
   .cph-wait/.cph-pkg so it can't collide with the site's existing global CSS, same
   approach as HotelSearchResultCards.css (see that file's header comment) - all the
   prototype's colour/font tokens are re-declared as --cph-* custom properties scoped to
   .cph-wait itself, not :root.

   This deliberately does NOT reuse the sitewide body.searching / .block-waiting-wrapper
   mechanism (Layout.css) other search pages still use for their own loading screen - this
   partial's own presence in the DOM is already gated by Vue's v-if="loading && currentPage
   === 0" in _SearchResultsContainer.cshtml, so it needs no separate show/hide class of its
   own, and staying off .block-waiting-wrapper means this redesign can't affect, or be
   affected by, any other page still using the old design.

   The prototype gates every animation behind a JS-toggled ".wait.is-on" class (it's a
   static element in the DOM the whole time, just hidden/shown). That's not needed here -
   Vue only ever mounts this markup while a search is actually loading, so every animation
   below just runs from the moment it appears.
   ============================================================================ */

.cph-wait {
  --cph-primary: #02aaa9;
  --cph-primary-dark: #218887;
  --cph-primary-deep: #104443;
  --cph-primary-mist: #def6f5;
  --cph-gold: #febb02;
  --cph-green: #23ae24;
  --cph-green-text: #008009;
  --cph-green-soft: #e3f7e4;
  --cph-text: #3c4e5a;
  --cph-text-muted: #707070;
  --cph-ink: #141515;
  --cph-border: #d8e0e0;
  --cph-page: #f4f8f8;
  --cph-font: "Lato", "Segoe UI", sans-serif;
  --cph-font-display: "Montserrat", "Lato", sans-serif;

  position: fixed;
  inset: 0;
  z-index: 999999999;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 170, 169, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  font-family: var(--cph-font);
}

.cph-wait *,
.cph-wait *::before,
.cph-wait *::after {
  box-sizing: border-box;
}

.cph-wait__card {
  position: relative;
  width: min(440px, 100%);
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(60, 78, 90, 0.22);
  animation: cph-wait-in 0.35s ease-out;
}

.cph-wait__hero {
  position: relative;
  height: 120px;
  overflow: hidden;
  background: #7aa8c4;
}

.cph-wait__hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
}

.cph-wait__plane {
  position: absolute;
  top: 10%;
  left: -16%;
  width: 14%;
  pointer-events: none;
  animation: cph-wait-fly 3.2s linear infinite;
}

.cph-wait__plane img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 3px 5px rgba(12, 36, 48, 0.22));
}

.cph-wait__body {
  padding: 18px 20px 16px;
  text-align: center;
}

.cph-wait__logo {
  display: block;
  width: min(200px, 66%);
  height: auto;
  margin: 0 auto;
}

.cph-wait__status {
  position: relative;
  height: 1.35em;
  /* cyprus-paradise-logo-on-light.svg already has "Est.1992" outlined into the artwork (no
     separate cph-wait__est line here - see the markup comment), so this carries a bit more
     top margin in its place. */
  margin: 12px 0 14px;
  font-size: 17px;
  font-weight: 800;
  color: var(--cph-text);
}

.cph-wait__status span {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.cph-wait__status span:nth-child(1) {
  animation: cph-wait-copy-1 9s linear infinite;
}

.cph-wait__status span:nth-child(2) {
  animation: cph-wait-copy-2 9s linear infinite;
}

.cph-wait__status span:nth-child(3) {
  animation: cph-wait-copy-3 9s linear infinite;
}

.cph-wait__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.cph-wait__steps li {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 8px;
  background: var(--cph-page);
  color: var(--cph-text-muted);
}

.cph-wait__steps strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--cph-text);
}

.cph-wait__steps span {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.cph-wait__steps li:nth-child(1) {
  animation: cph-wait-step-1 9s linear infinite;
}

.cph-wait__steps li:nth-child(2) {
  animation: cph-wait-step-2 9s linear infinite;
}

.cph-wait__steps li:nth-child(3) {
  animation: cph-wait-step-3 9s linear infinite;
}

/* ---- Package line (car + hotel + plane, ported from package-line.css) ---- */

.cph-pkg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 12px 0 14px;
  color: var(--cph-ink);
}

.cph-pkg__dots {
  display: flex;
  gap: 6px;
}

.cph-pkg__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cph-primary);
}

.cph-pkg__copy {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  color: var(--cph-primary);
}

.cph-pkg__plus {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: currentColor;
}

.cph-pkg svg {
  display: block;
  width: 42px;
  height: 34px;
  flex-shrink: 0;
  fill: currentColor;
}

.cph-wait__bar {
  width: min(240px, 72%);
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 999px;
  background: var(--cph-primary-mist);
  overflow: hidden;
}

.cph-wait__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cph-primary);
  animation: cph-wait-bar 9s linear infinite;
}

.cph-wait__protect {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cph-green-soft);
  color: var(--cph-green-text);
  font-size: 12px;
  font-weight: 800;
}

.cph-wait__protect svg {
  width: 14px;
  height: 14px;
}

.cph-wait__trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--cph-border);
  list-style: none;
}

.cph-wait__trust li {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.cph-wait__trust strong {
  font-size: 11px;
  font-weight: 800;
  color: var(--cph-text);
}

.cph-wait__trust span {
  font-size: 10px;
  font-weight: 700;
  color: var(--cph-text-muted);
  line-height: 1.25;
}

.cph-wait__trust img {
  width: 22px;
  height: 22px;
}

.cph-wait__num {
  font-family: var(--cph-font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--cph-primary);
  line-height: 1;
}

.cph-wait__stars {
  color: var(--cph-gold);
  font-size: 10px;
  letter-spacing: 0.5px;
}

@keyframes cph-wait-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cph-wait-fly {
  from {
    left: -16%;
  }
  to {
    left: 108%;
  }
}

@keyframes cph-wait-copy-1 {
  0%, 30% { opacity: 1; }
  34%, 100% { opacity: 0; }
}

@keyframes cph-wait-copy-2 {
  0%, 32% { opacity: 0; }
  34%, 63% { opacity: 1; }
  67%, 100% { opacity: 0; }
}

@keyframes cph-wait-copy-3 {
  0%, 65% { opacity: 0; }
  67%, 97% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes cph-wait-step-1 {
  0%, 30% {
    color: var(--cph-primary-dark);
    background: var(--cph-primary-mist);
    box-shadow: inset 0 0 0 1px #9ad9d6;
  }
  34%, 100% {
    color: var(--cph-text-muted);
    background: var(--cph-page);
    box-shadow: none;
  }
}

@keyframes cph-wait-step-2 {
  0%, 32% {
    color: var(--cph-text-muted);
    background: var(--cph-page);
    box-shadow: none;
  }
  34%, 63% {
    color: var(--cph-primary-dark);
    background: var(--cph-primary-mist);
    box-shadow: inset 0 0 0 1px #9ad9d6;
  }
  67%, 100% {
    color: var(--cph-text-muted);
    background: var(--cph-page);
    box-shadow: none;
  }
}

@keyframes cph-wait-step-3 {
  0%, 65% {
    color: var(--cph-text-muted);
    background: var(--cph-page);
    box-shadow: none;
  }
  67%, 97% {
    color: var(--cph-primary-dark);
    background: var(--cph-primary-mist);
    box-shadow: inset 0 0 0 1px #9ad9d6;
  }
  100% {
    color: var(--cph-text-muted);
    background: var(--cph-page);
    box-shadow: none;
  }
}

@keyframes cph-wait-bar {
  from { width: 0; }
  to { width: 100%; }
}

@media (max-width: 520px) {
  .cph-wait {
    padding: 12px;
    align-items: end;
  }

  .cph-wait__card {
    width: 100%;
    margin-bottom: 8px;
  }

  .cph-wait__hero {
    height: 100px;
  }

  .cph-pkg {
    gap: 6px 8px;
  }

  .cph-pkg svg {
    width: 34px;
    height: 28px;
  }

  .cph-pkg__copy {
    font-size: 10px;
  }

  .cph-pkg__dots:last-child {
    display: none;
  }

  .cph-wait__trust {
    grid-template-columns: 1fr 1fr;
    row-gap: 10px;
  }

  .cph-wait__status {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cph-wait__card,
  .cph-wait__plane,
  .cph-wait__status span,
  .cph-wait__steps li,
  .cph-wait__bar span {
    animation: none;
  }

  .cph-wait__status span:last-child,
  .cph-wait__plane {
    opacity: 1;
  }

  .cph-wait__plane {
    left: 52%;
    transform: translateX(-50%);
  }

  .cph-wait__steps li {
    background: var(--cph-primary-mist);
    color: var(--cph-primary-dark);
  }

  .cph-wait__bar span {
    width: 70%;
  }
}
