/* ══════════════════════════════════════════
   WithLore — Video Content Gap Calculator
   Standalone page styles
   ══════════════════════════════════════════ */

/* ── Page Layout ── */

.gap-page {
  background: var(--black);
  color: #fff;
  min-height: 100vh;
}

.gap-step {
  display: none;
  min-height: calc(100vh - 80px);
  padding: 120px 24px 80px;
  animation: gapFadeUp 0.45s ease-out;
}

.gap-step.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-step__inner {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

@keyframes gapFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress Bar ── */

.gap-progress {
  position: fixed;
  top: 68px; /* below nav */
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
  z-index: 90;
}

.gap-progress__bar {
  height: 100%;
  background: var(--gold);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ── Step Header ── */

.gap-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.gap-kicker::before {
  content: '';
  width: 32px;
  height: 2px;
  background: var(--gold);
}

.gap-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gap-title em {
  font-style: italic;
  color: var(--gold);
}

.gap-sub {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
  max-width: 520px;
  margin-bottom: 40px;
}

/* ── Back Button ── */

.gap-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.gap-back:hover {
  color: rgba(255,255,255,0.7);
}

.gap-back svg {
  width: 14px;
  height: 14px;
}

/* ── Channel Selection Grid ── */

.gap-channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gap-channel-card {
  padding: 28px 24px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: var(--font-body);
  color: #fff;
}

.gap-channel-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
}

.gap-channel-card.selected {
  border-color: var(--gold);
  background: rgba(254,193,6,0.06);
}

.gap-channel-card--full {
  grid-column: 1 / -1;
}

.gap-channel-card__icon {
  margin-bottom: 12px;
}

.gap-channel-card__icon svg {
  width: 28px;
  height: 28px;
  color: var(--gold);
}

.gap-channel-card__label {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.gap-channel-card__sub {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* ── Option Cards (card-select questions) ── */

.gap-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gap-option-card {
  padding: 24px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: var(--font-body);
  color: #fff;
}

.gap-option-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
}

.gap-option-card.selected {
  border-color: var(--gold);
  background: rgba(254,193,6,0.06);
}

.gap-option-card__label {
  font-size: 20px;
  font-weight: 600;
}

.gap-option-card__sub {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
}

/* ── Number Input ── */

.gap-input-wrap {
  position: relative;
  margin-bottom: 12px;
}

.gap-input-wrap__prefix,
.gap-input-wrap__suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}

.gap-input-wrap__prefix {
  left: 20px;
}

.gap-input-wrap__suffix {
  right: 20px;
}

.gap-input {
  width: 100%;
  padding: 18px 20px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.gap-input::-webkit-inner-spin-button,
.gap-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.gap-input::placeholder {
  color: rgba(255,255,255,0.2);
}

.gap-input:focus {
  border-color: var(--gold);
}

.gap-input--has-prefix {
  padding-left: 40px;
}

.gap-input--has-suffix {
  padding-right: 40px;
}

.gap-input--error {
  border-color: var(--red-accent);
}

.gap-live-calc {
  font-size: 13px;
  color: var(--gold);
  min-height: 20px;
  margin-bottom: 8px;
  transition: opacity 0.3s;
}

.gap-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 32px;
}

.gap-error {
  font-size: 13px;
  color: var(--red-accent);
  margin-top: -4px;
  margin-bottom: 8px;
  display: none;
}

.gap-error.visible {
  display: block;
}

/* ── Next Button ── */

.gap-next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  background: var(--gold);
  padding: 16px 32px;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 16px;
}

.gap-next:hover {
  background: var(--gold-dim);
  transform: translateY(-1px);
}

.gap-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.gap-next svg {
  width: 16px;
  height: 16px;
}

.gap-next--final {
  font-size: 16px;
  padding: 18px 40px;
}

/* ── Calculating Animation ── */

.gap-calc-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 420px;
}

.gap-calc-step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease-out;
}

.gap-calc-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.gap-calc-step.done {
  color: #22c55e;
}

.gap-calc-step__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-calc-step__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: gapSpin 0.7s linear infinite;
}

.gap-calc-step.done .gap-calc-step__spinner {
  display: none;
}

.gap-calc-step__check {
  display: none;
  color: #22c55e;
}

.gap-calc-step.done .gap-calc-step__check {
  display: block;
}

@keyframes gapSpin {
  to { transform: rotate(360deg); }
}

/* ── Results ── */

.gap-results {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

/* Hero Metric */
.gap-results__hero {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.gap-results__hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 20px;
}

.gap-results__hero-value {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

.gap-results__hero-range {
  font-size: clamp(36px, 5.5vw, 56px);
  color: var(--gold);
  display: block;
  margin: 8px 0;
  font-weight: 400;
  letter-spacing: -0.02em;
  transition: color 0.4s ease;
}

/* Severity color coding */
.gap-severity--red {
  color: #e8380d !important;
  text-shadow: 0 0 40px rgba(232, 56, 13, 0.3);
}
.gap-severity--orange {
  color: #f59e0b !important;
  text-shadow: 0 0 40px rgba(245, 158, 11, 0.2);
}
.gap-severity--gold {
  color: var(--gold) !important;
}

.gap-results__hero-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.4);
  max-width: 500px;
  margin: 16px auto 0;
  line-height: 1.6;
}

/* Bar Chart */
.gap-results__chart {
  margin-bottom: 40px;
}

.gap-results__chart-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: 20px;
}

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

.gap-results__bar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gap-results__bar-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  width: 200px;
  flex-shrink: 0;
  text-align: right;
  line-height: 1.4;
}

.gap-results__bar-track {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 44px;
}

.gap-results__bar {
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  min-width: 40px;
  display: flex;
  align-items: center;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.gap-results__bar--current {
  background: rgba(255,255,255,0.1);
}

.gap-results__bar--optimized {
  background: var(--gold);
}

.gap-results__bar-value {
  position: absolute;
  right: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.gap-results__bar--optimized .gap-results__bar-value {
  color: var(--black);
}

/* Video Comparison */
.gap-results__video-compare {
  margin-bottom: 40px;
  padding-top: 8px;
}

.gap-results__video-compare-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: 20px;
}

.gap-results__video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.gap-results__video-cell {
  display: flex;
  flex-direction: column;
}

.gap-results__video-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  text-align: center;
  margin-bottom: 0;
}

.gap-results__video-tag--generic {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.45);
}

.gap-results__video-tag--withlore {
  background: rgba(254,193,6,0.12);
  color: var(--gold);
}

.gap-results__video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

.gap-results__video-player video,
.gap-results__video-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gap-results__video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.15);
}

.gap-results__video-placeholder svg {
  width: 32px;
  height: 32px;
}

.gap-results__video-placeholder span {
  font-size: 12px;
  font-weight: 500;
}

/* Hide placeholder when video has loaded */
.gap-results__video-player video[data-loaded="true"] + .gap-results__video-placeholder {
  display: none;
}

/* Supporting Metrics */
.gap-results__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 32px;
}

.gap-results__metric {
  padding: 28px 24px;
  background: rgba(255,255,255,0.03);
}

.gap-results__metric-value {
  font-family: var(--font-display);
  font-size: 32px;
  margin-bottom: 6px;
}

.gap-results__metric-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

.gap-results__metric-explain {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
}

/* Methodology Footnote */
.gap-results__footnote {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  line-height: 1.6;
  margin-bottom: 40px;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Soft Gate */
.gap-results__gate {
  padding: 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 40px;
}

.gap-results__gate-text {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 20px;
  line-height: 1.6;
}

.gap-results__gate-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.gap-results__gate-fields .gap-input {
  font-size: 14px;
  padding: 14px 16px;
}

.gap-results__gate-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.gap-results__gate-skip {
  display: block;
  width: 100%;
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-align: center;
  padding: 0;
  transition: color 0.2s;
}

.gap-results__gate-skip:hover {
  color: rgba(255,255,255,0.5);
}

.gap-results__gate-success {
  font-size: 14px;
  color: #22c55e;
  text-align: center;
  padding: 16px 0;
}

/* CTA */
.gap-results__cta {
  padding: 40px 0 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.gap-results__cta-inner {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: center;
}

.gap-results__cta-photo {
  width: 180px;
  height: 220px;
  overflow: hidden;
  border-radius: 8px;
  flex-shrink: 0;
}

.gap-results__cta-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.gap-results__cta-content {
  text-align: left;
}

.gap-results__cta-text {
  font-size: 17px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  margin: 0 0 12px;
}

.gap-results__cta-text strong {
  color: #fff;
}

.gap-results__cta-founder {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  margin-bottom: 20px;
}

.gap-results__cta-founder strong {
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

.gap-results__cta-note {
  font-size: 13px;
  color: rgba(255,255,255,0.25);
  margin-top: 16px;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .gap-step {
    padding: 100px 20px 60px;
    align-items: flex-start;
    padding-top: 120px;
  }

  .gap-channel-grid {
    grid-template-columns: 1fr;
  }

  .gap-options-grid {
    grid-template-columns: 1fr;
  }

  .gap-input {
    font-size: 16px; /* prevents iOS zoom */
  }

  .gap-results__bar-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .gap-results__bar-label {
    width: auto;
    text-align: left;
  }

  .gap-results__bar-track {
    width: 100%;
  }

  .gap-results__video-grid {
    grid-template-columns: 1fr;
  }

  .gap-results__cta-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .gap-results__cta-photo {
    width: 120px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
  }

  .gap-results__cta-content {
    text-align: center;
  }

  .gap-results__metrics {
    grid-template-columns: 1fr;
  }

  .gap-results__gate-fields {
    grid-template-columns: 1fr;
  }

  .gap-channel-card {
    padding: 20px;
    min-height: 48px;
  }

  .gap-option-card {
    padding: 20px;
    min-height: 48px;
  }
}
