/* ============================================================
   FILE.BUSINESS — Premium Animated Explainer Player v2
   Real motion. Character avatars. Typed text. Document handoff.
   ============================================================ */

button.video-card {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  border: 0; padding: 0; width: 100%;
}

/* --- OVERLAY --- */
.fbv-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 14, 36, 0.92);
  backdrop-filter: blur(14px);
  z-index: 10000;
  display: none;
  align-items: center; justify-content: center;
  padding: 32px 24px;
  animation: fbvFadeIn 0.28s ease-out both;
}
.fbv-overlay.is-open { display: flex; }
@keyframes fbvFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- FRAME --- */
.fbv-frame {
  width: 100%; max-width: 920px;
  aspect-ratio: 16 / 9;
  background: #0a1330;
  border-radius: 18px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: fbvScaleIn 0.36s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes fbvScaleIn { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.fbv-stage {
  flex: 1; position: relative;
  background: linear-gradient(180deg, #0a1330 0%, #0f1e4b 100%);
  overflow: hidden;
}

/* Each scene is absolutely positioned, fades + slides */
.fbv-scene {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
  pointer-events: none;
}
.fbv-scene.is-active { opacity: 1; visibility: visible; }
.fbv-scene svg { display: block; width: 100%; height: 100%; }

/* --- CAPTION --- */
.fbv-caption {
  position: absolute; left: 0; right: 0; bottom: 64px;
  padding: 0 56px; text-align: center; pointer-events: none; z-index: 5;
}
.fbv-caption-inner {
  display: inline-block; max-width: 760px;
  background: rgba(8, 14, 36, 0.82);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 18px; font-weight: 500; line-height: 1.45;
  padding: 15px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  animation: fbvCaptionIn 0.5s ease-out both;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
@keyframes fbvCaptionIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- TOP BAR --- */
.fbv-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(8, 14, 36, 0.85) 0%, transparent 100%);
}
.fbv-title {
  color: #fff;
  font-family: 'Source Serif 4', serif;
  font-size: 15px; font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0; flex: 1; padding-right: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fbv-close {
  background: rgba(255, 255, 255, 0.08); border: 0; color: #fff;
  width: 38px; height: 38px; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.fbv-close:hover { background: rgba(255, 255, 255, 0.18); transform: scale(1.06); }

/* --- CHAPTER PROGRESS (segmented bar at top) --- */
.fbv-chapters {
  position: absolute; top: 60px; left: 22px; right: 22px;
  display: flex; gap: 4px; z-index: 6;
}
.fbv-chapter {
  flex: 1; height: 3px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
}
.fbv-chapter-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--fbv-accent, #6f8fce) 0%, #fff 100%);
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* --- BOTTOM CONTROLS --- */
.fbv-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px;
  background: linear-gradient(0deg, rgba(8, 14, 36, 0.85) 0%, transparent 100%);
}
.fbv-play {
  background: rgba(255, 255, 255, 0.12); border: 0; color: #fff;
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.fbv-play:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }
.fbv-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: rgba(255, 255, 255, 0.7);
  font-weight: 500; width: 84px;
}
.fbv-track {
  flex: 1; height: 5px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px; cursor: pointer; position: relative; overflow: hidden;
}
.fbv-track-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--fbv-accent, #6f8fce) 0%, #fff 100%);
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* --- END CARD --- */
.fbv-endcard {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a1330 0%, #1a3a8f 60%, #22388d 100%);
  z-index: 20; display: none;
  align-items: center; justify-content: center;
  padding: 40px;
  flex-direction: column; text-align: center;
  animation: fbvFadeIn 0.4s ease-out both;
}
.fbv-endcard.is-shown { display: flex; }
.fbv-endcard-eyebrow {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  margin-bottom: 14px;
}
.fbv-endcard-h {
  color: #fff;
  font-family: 'Source Serif 4', serif;
  font-size: 34px; font-weight: 500; line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 16px; max-width: 600px;
}
.fbv-endcard-sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px; line-height: 1.55;
  margin: 0 0 30px; max-width: 560px;
}
.fbv-endcard-row {
  display: inline-flex; gap: 12px;
  flex-wrap: wrap; justify-content: center;
}
.fbv-endcard-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 30px;
  background: #fff; color: #22388d;
  border-radius: 12px;
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fbv-endcard-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.4);
}
.fbv-endcard-replay {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 26px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  font-weight: 500; font-size: 14px;
  cursor: pointer; font-family: inherit;
}
.fbv-endcard-replay:hover { background: rgba(255, 255, 255, 0.10); }

/* --- ROADMAP (chapter map shown on the end card) --- */
.fbv-roadmap {
  margin-top: 26px; display: grid; gap: 10px;
  max-width: 560px;
}
.fbv-roadmap-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  text-align: left;
}
.fbv-roadmap-num {
  width: 26px; height: 26px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.fbv-roadmap-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px; line-height: 1.4;
}

/* --- MOBILE --- */
@media (max-width: 760px) {
  .fbv-overlay { padding: 16px; }
  .fbv-frame { aspect-ratio: auto; height: 92vh; max-height: 92vh; }
  .fbv-caption { bottom: 76px; padding: 0 20px; }
  .fbv-caption-inner { font-size: 14px; padding: 12px 16px; }
  .fbv-endcard-h { font-size: 22px; }
  .fbv-endcard-sub { font-size: 14px; }
  .fbv-chapters { top: 64px; left: 16px; right: 16px; }
}
