/* Mashhor Hub — Prompts page hero banner + image gallery + detail modal.
   Scoped so it never leaks into the shared platform styles. */
:root { --ps-green: #35d07f; --ps-green-soft: rgba(53,208,127,0.14); }

/* ── Hero banner ─────────────────────────────────────────────────────────── */
.ps-hero {
  position: relative; overflow: hidden; border-radius: 22px;
  margin: 22px auto 8px; padding: clamp(28px, 5vw, 56px);
  /* Match the site's identity: a subtle glass panel over the page's own dark background,
     with a faint brand accent (no heavy green block). */
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(53,208,127,0.10), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  border: 1px solid rgba(255,255,255,0.08);
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 24px; align-items: center;
}
/* Full-bleed background video (bg4) behind the whole hero — prominent, with a scrim for legibility */
.ps-hero__bgvid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.7; z-index: 0; pointer-events: none; filter: saturate(1.05); }
.ps-hero__scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,13,26,0.62), rgba(5,13,26,0.80)); }
.ps-hero__content { position: relative; z-index: 3; }
/* flip: video/showcase on the reading-start, copy on the reading-end (EN: video left/text right; AR reversed) */
.ps-hero--flip .ps-hero__visual { order: -1; }
/* scattered tool logos floating around the showcase */
.ps-hero__scatter { position: absolute; inset: -4% -2%; z-index: 4; pointer-events: none; }
.ps-tool { position: absolute; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border-radius: 13px; background: rgba(9,18,32,0.78); border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 8px 22px rgba(0,0,0,0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: ps-toolfloat 6s ease-in-out infinite; }
.ps-tool img { width: 27px; height: 27px; object-fit: contain; }
@keyframes ps-toolfloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .ps-tool { animation: none; } }
.ps-tool-1 { top: 3%;  inset-inline-start: 1%; }
.ps-tool-2 { top: 12%; inset-inline-end: 2%;  animation-delay: -1s; }
.ps-tool-3 { top: 42%; inset-inline-start: -1%; animation-delay: -2s; }
.ps-tool-4 { bottom: 12%; inset-inline-end: 1%; animation-delay: -3s; }
.ps-tool-5 { bottom: 2%; inset-inline-start: 16%; animation-delay: -1.5s; }
.ps-tool-6 { top: 0%; inset-inline-end: 26%; animation-delay: -2.5s; }
.ps-tool-7 { top: 34%; inset-inline-end: 8%;  animation-delay: -0.5s; }
.ps-tool-8 { bottom: 30%; inset-inline-start: 3%; animation-delay: -3.5s; }
.ps-tool-9 { top: 64%; inset-inline-end: -1%; animation-delay: -2.2s; }
.ps-hero__badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; color: #d7f7e6;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); margin-bottom: 18px;
}
.ps-hero__title {
  font-size: clamp(2.1rem, 5vw, 3.5rem); line-height: 1.08; font-weight: 800;
  color: #fff; margin: 0 0 14px; letter-spacing: -0.5px;
}
.ps-hero__title [data-ps-highlight] { color: var(--ps-green); }
.ps-hero__subtitle { font-size: clamp(1rem, 1.6vw, 1.18rem); color: rgba(255,255,255,0.78); line-height: 1.7; max-width: 52ch; margin: 0 0 22px; }
.ps-hero__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.ps-chip {
  font-size: 0.82rem; font-weight: 600; color: #cdeede; padding: 9px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
}
.ps-hero__cta {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem;
  padding: 14px 30px; border-radius: 14px; color: #05130c; text-decoration: none;
  background: var(--ps-green); transition: transform .2s, box-shadow .2s;
  box-shadow: 0 12px 30px rgba(53,208,127,0.28);
}
.ps-hero__cta:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(53,208,127,0.38); }
/* two CTAs on one line (Explore all + Contact us) */
.ps-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ps-hero__cta--ghost { background: transparent; color: #d7f7e6; border: 1px solid rgba(255,255,255,0.24); box-shadow: none; }
.ps-hero__cta--ghost:hover { background: rgba(255,255,255,0.07); box-shadow: none; }

/* Right visual: floating showcase cards, or a single banner image */
.ps-hero__visual { position: relative; z-index: 1; min-height: 220px; }
/* A single banner renders as a contained, professionally-fitted card (any upload size fits). */
.ps-hero__banner.has-media { border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.5); aspect-ratio: 4/3; max-height: 440px; margin-inline: auto; }
.ps-hero__banner img, .ps-hero__banner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-hero__showcase { position: relative; height: 100%; min-height: 300px; }
.ps-hero__showcase.has-media .ps-show-card {
  position: absolute; width: 42%; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden;
  box-shadow: 0 22px 50px rgba(0,0,0,0.55); border: 3px solid rgba(255,255,255,0.06);
  /* branded logo tile shows behind the media until the video/image paints — no filename text */
  background: #0b1220;
  /* base rotation + JS parallax offset live in transform; the animation drives `translate`
     (the independent transform property) so the two compose cleanly. */
  --rot: 0deg; --px: 0px; --py: 0px;
  transform: translate(var(--px), var(--py)) rotate(var(--rot));
  transition: transform .25s ease-out, scale .25s ease, box-shadow .25s ease; will-change: transform;
}
/* subtle hover reaction on the floating cards (scale is independent → composes with the float) */
.ps-hero__showcase.has-media .ps-show-card:hover { scale: 1.06; z-index: 8; box-shadow: 0 30px 60px rgba(0,0,0,0.6); }
.ps-show-card img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.ps-show-card video { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
/* loading state: the Mashhor logo pulses behind the (still-transparent) video until it paints */
.ps-show-card::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background: url(/assets/images/icons/logo-flat-160.webp) center / 42% auto no-repeat;
  animation: ps-logopulse 1.9s ease-in-out infinite; }
@keyframes ps-logopulse { 0%, 100% { opacity: .38; transform: scale(.94); } 50% { opacity: .85; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ps-show-card::before { animation: none; opacity: .6; } }
.ps-show-1 { top: 6%;  inset-inline-start: 4%;  --rot: -7deg; z-index: 2; }
.ps-show-2 { top: 0;   inset-inline-start: 30%; --rot: 2deg;  z-index: 3; }
.ps-show-3 { top: 12%; inset-inline-end: 3%;    --rot: 8deg;  z-index: 1; }
.ps-show-4 { bottom: 4%; inset-inline-start: 16%; --rot: 4deg; z-index: 2; }
.ps-show-5 { bottom: 8%; inset-inline-end: 20%;   --rot: -4deg; z-index: 1; }

/* ── Showcase animation presets (float | tilt | sway | parallax) ─────────────
   Each drives the independent `translate`/`rotate` props, staggered per card. */
@keyframes ps-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -16px; } }
@keyframes ps-tilt  { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -9px; rotate: 3deg; } }
@keyframes ps-sway  { 0%,100% { translate: 0 0; rotate: 0deg; } 33% { translate: -11px -6px; rotate: -2.5deg; } 66% { translate: 11px -6px; rotate: 2.5deg; } }
.ps-anim-float .ps-show-card { animation: ps-float 5.5s ease-in-out infinite; }
.ps-anim-tilt  .ps-show-card { animation: ps-tilt 6s ease-in-out infinite; }
.ps-anim-sway  .ps-show-card { animation: ps-sway 8s ease-in-out infinite; }
.ps-anim-parallax .ps-show-card { animation: ps-float 7s ease-in-out infinite; } /* + JS mouse parallax */
.ps-hero__showcase[class*="ps-anim-"] .ps-show-2 { animation-delay: -1.6s; }
.ps-hero__showcase[class*="ps-anim-"] .ps-show-3 { animation-delay: -3.2s; }
.ps-hero__showcase[class*="ps-anim-"] .ps-show-4 { animation-delay: -0.8s; }
.ps-hero__showcase[class*="ps-anim-"] .ps-show-5 { animation-delay: -2.4s; }
@media (prefers-reduced-motion: reduce) { .ps-hero__showcase .ps-show-card { animation: none !important; } }

/* ── Full-bleed hero on desktop (spans the whole page width) ─────────────────*/
@media (min-width: 861px) {
  section[data-prompts-hero] { max-width: none; width: 100vw; margin-inline: calc(50% - 50vw); padding: 0; }
  section[data-prompts-hero] .ps-hero {
    border-radius: 0; margin: 0; min-height: 460px; align-content: center;
    padding-inline: clamp(48px, 7vw, 160px); padding-block: clamp(40px, 5vw, 80px);
  }
}

/* ── Distinctive filter pills ────────────────────────────────────────────────*/
#vFilters .vcf-btn {
  border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 0.82rem;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
  color: #cbd5e1; cursor: pointer; transition: all .2s; letter-spacing: 0.02em; line-height: 1;
}
#vFilters .vcf-btn:hover { border-color: rgba(53,208,127,0.45); color: #fff; transform: translateY(-1px); }
#vFilters .vcf-btn.active {
  background: linear-gradient(135deg, var(--ps-green), #2bb36a); color: #05130c;
  border-color: transparent; box-shadow: 0 8px 20px rgba(53,208,127,0.32);
}

/* Clean centered hero when no banner/showcase image is configured yet. */
.ps-hero--solo { grid-template-columns: 1fr; text-align: center; }
.ps-hero--solo .ps-hero__visual { display: none; }
.ps-hero--solo .ps-hero__chips { justify-content: center; }
.ps-hero--solo .ps-hero__subtitle { margin-inline: auto; }

@media (max-width: 860px) {
  /* start the hero close to the header (the section otherwise keeps its 38px top padding on mobile) */
  section[data-prompts-hero] { padding-top: 6px !important; }
  .ps-hero { grid-template-columns: 1fr; text-align: center; display: flex; flex-direction: column; }
  /* on phones: media/showcase FIRST, then the copy below it */
  .ps-hero__visual { order: -1; min-height: 0; margin: 0 0 4px; }
  /* decorative scattered tool icons: keep only 4, smaller, so they don't clutter the phone hero */
  .ps-tool { width: 36px; height: 36px; border-radius: 10px; }
  .ps-tool img { width: 21px; height: 21px; }
  .ps-hero__scatter .ps-tool-5, .ps-hero__scatter .ps-tool-6, .ps-hero__scatter .ps-tool-7,
  .ps-hero__scatter .ps-tool-8, .ps-hero__scatter .ps-tool-9 { display: none; }
  .ps-hero__bgvid { opacity: 0.55; }
  .ps-hero__chips { justify-content: center; }
  .ps-hero__subtitle { margin-inline: auto; }
  .ps-hero__actions { justify-content: center; }
  /* tighten the gap above the hero + inside it so it starts near the header */
  .ps-hero { margin-top: 10px; padding: 18px 16px 22px; }
  .ps-hero__badge { margin-bottom: 12px; }
  .ps-hero__subtitle { margin-bottom: 18px; }
  /* keep the two CTAs side-by-side, shrink to fit */
  .ps-hero__actions { flex-wrap: nowrap; gap: 10px; }
  .ps-hero__actions .ps-hero__cta { flex: 1 1 0; justify-content: center; padding: 12px 14px; font-size: 0.92rem; }
  /* the desktop "floating cards" collapse on a narrow column — render the showcase as a
     clean, visible row of real image/video thumbnails instead (so the media actually shows) */
  .ps-hero__visual { width: 100%; }
  .ps-hero__showcase { min-height: 0; height: auto; display: flex; gap: 9px; justify-content: center; align-items: stretch; }
  .ps-hero__showcase.has-media .ps-show-card {
    position: static; inset: auto; width: 31%; max-width: 132px; aspect-ratio: 3/4; margin: 0;
    transform: none !important; animation: none !important; border-width: 2px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.45);
  }
  .ps-hero__showcase.has-media .ps-show-card video { width: 100%; height: 100%; object-fit: cover; }
  .ps-hero__showcase .ps-show-4, .ps-hero__showcase .ps-show-5 { display: none; }
  .ps-hero__banner.has-media { aspect-ratio: 16/10; max-height: 220px; }
}
@media (max-width: 560px) {
  #pm-root.pm-wrap { padding-top: 6px; }
  section[data-prompts-hero] { padding-top: 4px !important; }
  .ps-hero { margin-top: 4px; }
}

/* ── Image gallery thumbnails on vault cards ─────────────────────────────── */
.vcard.has-image .vcard-image {
  display: block; width: calc(100% + 2px); margin: -1px -1px 14px; height: 200px;
  object-fit: cover; border-radius: 12px 12px 0 0; cursor: pointer;
}
.vcard-open-btn {
  margin-top: 10px; width: 100%; padding: 10px; border-radius: 10px; cursor: pointer;
  font-weight: 700; font-size: 0.85rem; color: #d7f7e6;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  transition: background .2s, border-color .2s;
}
.vcard-open-btn:hover { background: var(--ps-green-soft); border-color: rgba(53,208,127,0.4); }

/* ── Detail modal ────────────────────────────────────────────────────────── */
#ps-modal { position: fixed; inset: 0; z-index: 9999; display: none; }
#ps-modal.open { display: block; }
.ps-modal-backdrop { position: absolute; inset: 0; background: rgba(3,8,6,0.82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ps-modal-card {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: min(960px, 94vw); max-height: 92vh; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: #0b0f0d; border: 1px solid rgba(53,208,127,0.2); border-radius: 20px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.6);
}
.ps-modal-x {
  position: absolute; top: 12px; inset-inline-end: 14px; z-index: 5; width: 38px; height: 38px;
  border-radius: 50%; border: none; cursor: pointer; font-size: 1.5rem; line-height: 1;
  color: #fff; background: rgba(0,0,0,0.5);
}
.ps-modal-media { background: #050806; display: flex; align-items: center; justify-content: center; max-height: 92vh; }
.ps-modal-media img, .ps-modal-media video { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; }
.ps-modal-body { padding: 26px 24px; overflow-y: auto; max-height: 92vh; display: flex; flex-direction: column; }
.ps-modal-tags { display: flex; gap: 8px; margin-bottom: 12px; }
.ps-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 5px 10px; border-radius: 8px; background: var(--ps-green-soft); color: var(--ps-green); }
.ps-tag-tool { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); }
.ps-modal-title { font-size: 1.3rem; font-weight: 800; color: #fff; margin: 0 0 16px; }
.ps-modal-prompt {
  flex: 1; white-space: pre-wrap; font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 0.9rem; line-height: 1.75; color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 16px; overflow-y: auto; max-height: 46vh;
}
.ps-modal-actions { margin-top: 18px; }
.ps-copy-btn {
  width: 100%; padding: 15px; border-radius: 12px; border: none; cursor: pointer;
  font-weight: 800; font-size: 1rem; color: #05130c; background: var(--ps-green);
  transition: filter .2s;
}
.ps-copy-btn:hover { filter: brightness(1.06); }

@media (max-width: 760px) {
  .ps-modal-card { grid-template-columns: 1fr; max-height: 94vh; overflow-y: auto; }
  .ps-modal-media { max-height: 44vh; }
  .ps-modal-media img, .ps-modal-media video { max-height: 44vh; }
}

/* ── Banner colour overlay + optional full-width banner (backend-controlled) ── */
.ps-hero__banner { position: relative; }
.ps-banner__ov { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
/* Full-width: ONLY the banner becomes the absolute backdrop (anchored to .ps-hero,
   which is position:relative). The visual column stays in normal flow so the floating
   showcase cards keep their place and sit ABOVE the scrim — the v471 bug put the whole
   visual (banner + showcase) at z-index:0, burying the showcase. */
.ps-hero--fullbanner .ps-hero__visual { position: static; z-index: 2; min-height: 300px; }
.ps-hero--fullbanner .ps-hero__banner.has-media {
  position: absolute; inset: 0; z-index: 0; border-radius: 22px; overflow: hidden;
  aspect-ratio: auto; max-height: none; height: 100%; width: 100%; margin: 0; box-shadow: none;
}
.ps-hero--fullbanner .ps-hero__banner img, .ps-hero--fullbanner .ps-hero__banner video { height: 100%; width: 100%; }
.ps-hero--fullbanner .ps-hero__banner .ps-banner__ov { border-radius: 22px; }
.ps-hero--fullbanner .ps-hero__content,
.ps-hero--fullbanner .ps-hero__showcase { position: relative; z-index: 2; }
/* Readability scrim between the banner backdrop and the content/showcase. */
.ps-hero--fullbanner::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,10,18,0.82), rgba(6,10,18,0.35) 60%, transparent); border-radius: 22px; }
.ps-hero[dir="rtl"].ps-hero--fullbanner::after, [dir="rtl"] .ps-hero--fullbanner::after { background: linear-gradient(270deg, rgba(6,10,18,0.82), rgba(6,10,18,0.35) 60%, transparent); }
/* On phones the hero stacks to 1 column — keep the banner readable + showcase visible. */
@media (max-width: 760px) {
  .ps-hero--fullbanner::after { background: linear-gradient(180deg, rgba(6,10,18,0.6), rgba(6,10,18,0.85)); }
  .ps-hero--fullbanner .ps-hero__visual { min-height: 200px; }
}
