/**
 * Testimonials Stacked Deck CSS — Octopus KSA
 * 100% matched to truevs.sa visual & motion physics with Octopus identity.
 */

/* Section wrapper */
.oct-testimonials-deck-section {
  padding-block: clamp(4.5rem, 8vw, 8rem);
  background: var(--paper, #f8fafc);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Ambient glow in background */
.oct-testimonials-deck-section::after {
  content: "";
  position: absolute;
  inset-inline-start: -10vw;
  top: -8vw;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 87, 34, 0.08), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
}

/* Two-column responsive grid */
.oct-deck-grid {
  display: grid;
  grid-template-columns: minmax(0, 3.8fr) minmax(0, 8.2fr);
  column-gap: clamp(2.5rem, 5vw, 5rem);
  row-gap: 2.5rem;
  align-items: start;
}

/* Right column (interactive text & controls in RTL) */
.oct-deck-info-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  text-align: right !important;
  position: sticky;
  top: 110px;
}

[dir="rtl"] .oct-deck-info-col {
  align-items: flex-start !important;
  text-align: right !important;
}

.oct-deck-title {
  font-family: 'Cairo', 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: clamp(1.75rem, 2.7vw, 2.45rem) !important;
  font-weight: 800 !important;
  line-height: 1.32 !important;
  margin-block: 0.5rem 0.95rem !important;
  letter-spacing: -0.015em !important;
  color: #0F172A !important;
  text-align: right !important;
  margin-inline: 0 !important;
  width: auto !important;
}

[dir="rtl"] .oct-deck-title {
  text-align: right !important;
  margin-inline: 0 !important;
}

/* Skewed Neon Highlight Box removed — replaced with clean brand typography */
.oct-highlight-box {
  position: relative;
  display: inline;
  color: inherit;
}

/* Instructional hint */
.oct-deck-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #64748B;
  font-weight: 600;
  margin-block-end: 1.25rem;
}

/* Animated mini card icon */
.oct-deck-hint-card {
  width: 18px;
  height: 24px;
  border: 1.8px solid #FF5722;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  animation: oct-hint-tilt 2.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

[dir="rtl"] .oct-deck-hint-card {
  --hint-dir: -1;
}

[dir="ltr"] .oct-deck-hint-card {
  --hint-dir: 1;
}

.oct-deck-hint-card::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 3px;
  right: 3px;
  height: 1.5px;
  background: #94a3b8;
  border-radius: 1px;
  box-shadow: 0 5px 0 #94a3b8, 0 10px 0 #94a3b8;
}

@keyframes oct-hint-tilt {
  0%, 100% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(calc(var(--hint-dir, -1) * 7px)) rotate(calc(var(--hint-dir, -1) * 6deg));
  }
  50% {
    transform: translateX(calc(var(--hint-dir, -1) * -7px)) rotate(calc(var(--hint-dir, -1) * -6deg));
  }
  75% {
    transform: translateX(calc(var(--hint-dir, -1) * 3px)) rotate(calc(var(--hint-dir, -1) * 3deg));
  }
}

/* Illustration scene */
.oct-deck-scene-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin-block-start: 1.5rem;
}

.oct-deck-glow {
  position: absolute;
  inset: 12% 5% 5%;
  background: radial-gradient(circle, rgba(255, 87, 34, 0.18), rgba(2, 132, 199, 0.08), transparent 72%);
  filter: blur(28px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.oct-deck-lottie {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  position: relative;
  z-index: 1;
}

/* Left column (Cards & Controls) */
.oct-deck-cards-col {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

/* The viewport holding the stacked deck */
.oct-deck-viewport {
  position: relative;
  width: 100%;
  display: grid;
  padding-block-end: 58px;
  touch-action: pan-y;
}

/* Individual Testimonial Card */
.oct-deck-card {
  grid-area: 1 / 1;
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.03);
  padding: clamp(28px, 3.8vw, 52px);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  cursor: grab;
  transform-origin: 50% 100%;
  box-sizing: border-box;

  /* 3D Stack Depth calculation */
  --lift: max(0, calc(var(--k, 0) - var(--pull, 0)));
  translate: 0 calc(var(--lift) * 16px);
  scale: calc(1 - var(--lift) * 0.042);
  transition: translate 0.75s cubic-bezier(0.16, 1, 0.3, 1), scale 0.75s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s;
}

.oct-deck-card.is-dragging {
  cursor: grabbing !important;
  transition: none !important;
}

/* Top accent line */
.oct-deck-card::before {
  content: "";
  position: absolute;
  inset-block-start: -1px;
  inset-inline: clamp(28px, 3.8vw, 52px);
  height: 3px;
  background: linear-gradient(90deg, #FF5722 0%, #FF7A45 50%, #0284C7 100%);
  border-radius: 3px;
  transform: scaleX(0);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.oct-deck-card.is-current::before {
  transform: scaleX(1);
}

/* Underlying cards hierarchy */
.oct-deck-card.is-under {
  visibility: visible;
  background: #f8fafc;
}

.oct-deck-card.is-under:not(.is-next) > * {
  opacity: 0;
  pointer-events: none;
}

.oct-deck-card.is-next {
  background: #ffffff;
}

.oct-deck-card.is-next > * {
  opacity: 0.15;
}

.oct-deck-card:not(.is-current):not(.is-under) {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

/* Quote mark SVG */
.oct-quote-mark {
  width: clamp(28px, 2.4vw, 36px);
  height: auto;
  fill: #FF5722;
  opacity: 0.28;
  margin-block-end: 16px;
  display: block;
}

[dir="rtl"] .oct-quote-mark {
  transform: scaleX(-1);
}

/* Quote text */
.oct-card-quote {
  margin: 0;
  padding: 0;
}

.oct-card-quote p {
  font-size: clamp(1.02rem, 0.94rem + 0.35vw, 1.22rem);
  font-weight: 600;
  line-height: 1.8;
  color: #1E293B;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: pretty;
}

/* Voice Note Audio Waveform Bar */
.oct-card-audio {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-block-start: 22px;
  padding: 10px 18px;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  max-width: 100%;
}

.oct-audio-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent, #ff5722);
  color: #ffffff;
  border: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.2s, background-color 0.2s;
  flex-shrink: 0;
}

.oct-audio-play-btn:hover {
  transform: scale(1.08);
  background: var(--accent-text, #ea580c);
}

.oct-audio-time {
  font-size: 0.825rem;
  font-family: monospace;
  color: #64748b;
  min-width: 2.8rem;
}

.oct-waveform-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.oct-wf-bar {
  width: 3px;
  background: #cbd5e1;
  border-radius: 2px;
  height: 8px;
  transition: height 0.3s, background-color 0.3s;
}

.oct-wf-bar:nth-child(2) { height: 16px; }
.oct-wf-bar:nth-child(3) { height: 12px; }
.oct-wf-bar:nth-child(4) { height: 18px; }
.oct-wf-bar:nth-child(5) { height: 14px; }
.oct-wf-bar:nth-child(6) { height: 19px; }
.oct-wf-bar:nth-child(7) { height: 10px; }
.oct-wf-bar:nth-child(8) { height: 17px; }
.oct-wf-bar:nth-child(9) { height: 13px; }
.oct-wf-bar:nth-child(10) { height: 15px; }
.oct-wf-bar:nth-child(11) { height: 9px; }
.oct-wf-bar:nth-child(12) { height: 14px; }

.oct-card-audio.is-playing .oct-wf-bar {
  background: var(--accent, #ff5722);
  animation: oct-wave-pulse 1s ease-in-out infinite alternate;
}

.oct-card-audio.is-playing .oct-wf-bar:nth-child(2n) {
  animation-delay: 0.2s;
}

.oct-card-audio.is-playing .oct-wf-bar:nth-child(3n) {
  animation-delay: 0.4s;
}

@keyframes oct-wave-pulse {
  from { transform: scaleY(0.4); }
  to { transform: scaleY(1.3); }
}

/* Card footer */
.oct-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-start: 28px;
  padding-block-start: 22px;
  border-block-start: 1px solid rgba(15, 23, 42, 0.06);
  gap: 16px;
  flex-wrap: wrap;
}

.oct-card-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.oct-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  border: 2px solid rgba(255, 87, 34, 0.25);
}

.oct-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.oct-card-author-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.oct-author-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.3;
}

.oct-author-sub {
  font-size: 0.84rem;
  color: #64748B;
  line-height: 1.4;
}

/* Industry badge / pill */
.oct-industry-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.825rem;
  font-weight: 600;
  color: #0284C7;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.22);
  white-space: nowrap;
}

/* Controls underneath the deck */
.oct-deck-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-block-start: 10px;
}

.oct-deck-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  color: #0F172A;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  padding: 0;
}

.oct-deck-btn:hover {
  border-color: #FF5722;
  background: #FF5722;
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(255, 87, 34, 0.25);
}

.oct-deck-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.oct-deck-progress-track {
  flex: 1;
  height: 3px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.oct-deck-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #FF5722, #FF7A45);
  transform-origin: right;
  transform: scaleX(0.1);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="ltr"] .oct-deck-progress-fill {
  transform-origin: left;
}

.oct-deck-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  min-width: 4.5rem;
  text-align: center;
}

.oct-current-num {
  color: #0F172A;
}

/* Tablet & Mobile responsive */
@media (max-width: 991px) {
  .oct-deck-grid {
    grid-template-columns: 1fr;
    row-gap: 2.5rem;
  }

  .oct-deck-info-col,
  [dir="rtl"] .oct-deck-info-col {
    position: static !important;
    align-items: center !important;
    text-align: center !important;
    justify-content: center !important;
    margin-inline: auto !important;
    width: 100% !important;
  }

  .oct-deck-title,
  [dir="rtl"] .oct-deck-title {
    text-align: center !important;
    margin-inline: auto !important;
  }

  .oct-deck-hint {
    justify-content: center !important;
    text-align: center !important;
    margin-inline: auto !important;
  }

  .oct-deck-info-col .oct-hero-badge-pill {
    margin-inline: auto !important;
  }

  .oct-deck-scene-wrapper {
    display: none; /* hide illustration on small screens to prioritize cards */
  }
}

@media (max-width: 767px) {
  .oct-deck-card {
    padding: 24px 20px;
    border-radius: 20px;
    translate: 0 calc(var(--lift) * 11px);
    scale: calc(1 - var(--lift) * 0.035);
  }

  .oct-deck-viewport {
    padding-block-end: 42px;
  }

  .oct-card-quote p {
    font-size: 1.02rem;
    line-height: 1.75;
  }

  .oct-deck-controls {
    gap: 14px;
  }

  .oct-deck-btn {
    width: 44px;
    height: 44px;
  }
}
