/* ============================================
   PROPYO — COMPOSANTS CARTE
   Démo · iPhone · Reels Instagram
   ============================================ */


/* ============================================
   DEMO CARD
   ============================================ */
/* Carrousel d'exemples — show/hide simple (seule la carte active est affichée) */
.demo-carousel {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

.demo-track {
  position: relative;
}

.demo-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(22, 25, 116, 0.04),
    0 40px 80px -20px rgba(22, 25, 116, 0.12);
}

.demo-card.is-active { display: block; }

.demo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px -10px rgba(12, 17, 64, 0.2);
}

.demo-nav:hover {
  background: var(--fg-strong);
  color: var(--bg-card);
  border-color: var(--fg-strong);
}

.demo-nav svg { width: 18px; height: 18px; }
.demo-nav-prev { left: -26px; }
.demo-nav-next { right: -26px; }

.demo-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-strong);
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.demo-dot.is-active {
  background: var(--fg-strong);
  border-color: var(--fg-strong);
  transform: scale(1.2);
}

@media (max-width: 900px) {
  .demo-nav { width: 40px; height: 40px; }
  .demo-nav-prev { left: 8px; }
  .demo-nav-next { right: 8px; }
}

.demo-body {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  min-height: 620px;
}

.demo-canvas {
  position: relative;
  background: var(--bg-warm);
  overflow: hidden;
}

.demo-canvas img,
.demo-canvas video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-media {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.canvas-media.is-active {
  opacity: 1;
}

.canvas-caption {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 2;
}

.canvas-caption-left {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.canvas-caption-right {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.canvas-processing {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-strong);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 3;
}

.canvas-processing.is-active {
  opacity: 1;
  transform: translateY(0);
}

.canvas-processing-spinner {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--accent-soft);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.demo-steps {
  display: flex;
  flex-direction: column;
  padding: 48px 32px;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
}

.demo-steps-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 24px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
  color: var(--fg);
  font-family: var(--font-sans);
  position: relative;
}

.step:last-of-type {
  border-bottom: none;
}

.step:hover .step-title {
  color: var(--fg-strong);
}

.step-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-style: italic;
  font-weight: 400;
  color: var(--fg-subtle);
  width: 40px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  padding-top: 2px;
}

.step.is-active .step-num,
.step.is-passed .step-num {
  color: var(--fg-strong);
}

.step-content {
  min-width: 0;
}

.step-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg-muted);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.step.is-active .step-title {
  color: var(--fg-strong);
}

.step-desc {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, margin-top 0.4s ease, opacity 0.3s ease;
  opacity: 0;
  font-weight: 300;
}

.step.is-active .step-desc {
  max-height: 200px;
  margin-top: 12px;
  opacity: 1;
}

.step-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: transparent;
  overflow: hidden;
}

.step-progress-fill {
  height: 100%;
  background: var(--fg-strong);
  width: 0;
  transform-origin: left;
}


/* ============================================
   IPHONE — frame et écran
   ============================================ */
.iphone {
  position: relative;
  width: 260px;
  height: 540px;
  background: #0a0a0a;
  border-radius: 44px;
  padding: 9px;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 30px 60px -15px rgba(22, 25, 116, 0.18);
  flex-shrink: 0;
}

/* Dynamic Island */
.iphone::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 24px;
  background: #0a0a0a;
  border-radius: 14px;
  z-index: 20;
}

.iphone-screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.iphone-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ============================================
   IPHONE REELS — feed Instagram complet
   ============================================ */
.iphone-reels .iphone-screen {
  background: #000;
}

.reels-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- HEADER REELS (haut) ---- */
.reels-header {
  position: absolute;
  top: 44px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.reels-header-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
}

.reels-header-btn svg {
  width: 22px;
  height: 22px;
}

.reels-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.reels-tab-current {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.reels-tab-friends {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
  font-weight: 500;
}

.reels-friends-bubbles {
  display: flex;
  align-items: center;
}

.reels-friend-bubble {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fa7e1e, #d62976);
  border: 1.5px solid white;
  display: inline-block;
}

.reels-friend-bubble:nth-child(2) {
  margin-left: -8px;
  background: linear-gradient(135deg, #962fbf, #4f5bd5);
}

/* ---- ACTIONS À DROITE (cœur, commentaire, share, send) ---- */
.reels-actions {
  position: absolute;
  right: 8px;
  bottom: 110px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  z-index: 5;
}

.reels-action {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
}

.reels-action svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.reels-icon-heart {
  fill: #ed4956;
}

.reels-count {
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.reels-action-more svg {
  width: 22px;
  height: 22px;
}

.reels-album {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid white;
  margin-top: 4px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.reels-album img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- INFO USER + CAPTION (BAS) ---- */
.reels-bottom {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 70px;
  z-index: 5;
}

.reels-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.reels-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--light-blue));
  position: relative;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.reels-user-avatar::after {
  content: "P";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
}

.reels-user-name {
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.reels-user-verified {
  width: 13px;
  height: 13px;
  background: #1d9bf0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 8px;
  font-weight: 700;
  flex-shrink: 0;
}

.reels-follow {
  margin-left: 4px;
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.reels-caption {
  color: white;
  font-size: 12px;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- BARRE DE PROGRESSION ---- */
.reels-progress {
  position: absolute;
  bottom: 44px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  z-index: 5;
}

.reels-progress-fill {
  height: 100%;
  width: 35%;
  background: white;
}

/* ---- TABBAR INSTAGRAM (très bas) ---- */
.reels-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 5;
}

.reels-tab-item {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reels-tab-item svg {
  width: 22px;
  height: 22px;
}

.reels-tab-active svg {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.reels-tab-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fa7e1e, #d62976);
  border: 2px solid white;
}


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .iphone {
    width: 240px;
    height: 500px;
  }

  .reels-header {
    top: 40px;
  }

  .reels-actions {
    bottom: 100px;
    gap: 14px;
  }

  .reels-action svg {
    width: 24px;
    height: 24px;
  }

  .reels-album {
    width: 26px;
    height: 26px;
  }

  .reels-bottom {
    bottom: 56px;
  }
}

@media (max-width: 900px) {
  /* Demo card en colonne */
  .demo-body {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .demo-canvas {
    aspect-ratio: 4 / 3;
  }

  .demo-steps {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 24px;
  }

  /* iPhones */
  .iphone {
    width: 220px;
    height: 460px;
  }

  /* Reels mobile */
  .reels-header {
    top: 36px;
  }

  .reels-tabs {
    font-size: 12px;
    gap: 10px;
  }

  .reels-actions {
    bottom: 90px;
    gap: 12px;
  }

  .reels-action svg {
    width: 22px;
    height: 22px;
  }

  .reels-count {
    font-size: 10px;
  }

  .reels-album {
    width: 24px;
    height: 24px;
  }

  .reels-bottom {
    bottom: 52px;
    right: 60px;
  }

  .reels-user-name,
  .reels-caption {
    font-size: 11px;
  }

  .reels-tabbar {
    height: 40px;
  }

  .reels-tab-item svg {
    width: 20px;
    height: 20px;
  }
}
