/* ===================================================
   ANIMATIONS — Mockups SaaS animés en pur CSS/JS
   =================================================== */

/* ---------- HERO MOCKUP — Génération de devis IA ---------- */
.hero-anim {
  display: flex;
  height: 360px;
}

.hero-anim-sidebar {
  width: 220px;
  border-right: 1px solid var(--line);
  padding: 1rem 0.75rem;
  background: var(--bg-soft);
}

.hero-anim-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.hero-anim-logo-mark {
  width: 18px;
  height: 18px;
  background: var(--ink);
  border-radius: 5px;
}

.hero-anim-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.hero-anim-nav li {
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-anim-nav li.active {
  background: var(--bg-card);
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.hero-anim-nav-icon {
  width: 14px;
  height: 14px;
  background: currentColor;
  opacity: 0.5;
  border-radius: 3px;
}

.hero-anim-main {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.hero-anim-title {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.hero-anim-chat {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--line);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.hero-anim-message {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0;
  animation: messageIn 0.6s var(--ease-out) forwards;
}

.hero-anim-message-avatar {
  width: 24px;
  height: 24px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.hero-anim-message.user .hero-anim-message-avatar {
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-anim-message-bubble {
  background: var(--bg-card);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  flex: 1;
  max-width: 80%;
}

.hero-anim-message.assistant {
  animation-delay: 1.2s;
}

.hero-anim-typing {
  display: inline-flex;
  gap: 3px;
}

.hero-anim-typing span {
  width: 5px;
  height: 5px;
  background: var(--ink-subtle);
  border-radius: 50%;
  animation: typingDot 1.2s ease-in-out infinite;
}

.hero-anim-typing span:nth-child(2) { animation-delay: 0.15s; }
.hero-anim-typing span:nth-child(3) { animation-delay: 0.3s; }

.hero-anim-devis {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0;
  transform: translateY(8px);
  animation: devisIn 0.6s var(--ease-out) forwards;
  animation-delay: 2.6s;
}

.hero-anim-devis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-anim-devis-title {
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-anim-devis-num {
  font-size: 0.6875rem;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
}

.hero-anim-devis-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.25rem 0;
  color: var(--ink-soft);
  opacity: 0;
  animation: lineIn 0.4s var(--ease-out) forwards;
}

.hero-anim-devis-line:nth-child(2) { animation-delay: 3.0s; }
.hero-anim-devis-line:nth-child(3) { animation-delay: 3.2s; }
.hero-anim-devis-line:nth-child(4) { animation-delay: 3.4s; }

.hero-anim-devis-total {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: lineIn 0.4s var(--ease-out) forwards;
  animation-delay: 3.7s;
}

/* Curseur animé */
.hero-anim-cursor {
  position: absolute;
  width: 14px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18' fill='none'%3E%3Cpath d='M1 1L1 14L4.5 11L7 17L9 16L6.5 10L11 9.5L1 1Z' fill='%230a0a0a' stroke='white' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
  animation: cursorPath 6s var(--ease-out) infinite;
}

@keyframes cursorPath {
  0%   { left: 70%; top: 30%; opacity: 0; }
  5%   { opacity: 1; }
  20%  { left: 50%; top: 75%; }
  35%  { left: 50%; top: 75%; transform: scale(0.85); }
  40%  { left: 50%; top: 75%; transform: scale(1); }
  60%  { left: 50%; top: 88%; }
  70%  { left: 50%; top: 88%; opacity: 1; }
  80%  { opacity: 0; }
  100% { left: 50%; top: 88%; opacity: 0; }
}

@keyframes messageIn {
  to { opacity: 1; }
}

@keyframes devisIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lineIn {
  to { opacity: 1; }
}

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* Effet "tape à la machine" pour le user message */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 1px solid var(--ink);
  width: 0;
  animation: typing 1.2s steps(36) forwards, blinkCaret 0.8s step-end infinite;
  animation-delay: 0.4s, 0.4s;
}

@keyframes typing {
  to { width: 100%; }
}

@keyframes blinkCaret {
  50% { border-right-color: transparent; }
}

/* ---------- SOLUTION CARD MOCKUPS ---------- */

/* Solution 1 : Dashboard de gestion */
.mock-dashboard {
  position: absolute;
  inset: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.mock-dashboard-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mock-dashboard-bar {
  background: var(--bg-soft);
  border-radius: 3px;
  height: 8px;
  flex: 1;
}

.mock-dashboard-bar.dark { background: var(--ink); }
.mock-dashboard-bar.short { flex: 0 0 30%; }
.mock-dashboard-bar.medium { flex: 0 0 50%; }

.mock-dashboard-card {
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 32px;
  position: relative;
  overflow: hidden;
}

.mock-dashboard-card::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 8px;
  right: 8px;
  height: 16px;
  background: linear-gradient(180deg, transparent 0%, var(--ink) 50%, var(--ink) 100%);
  clip-path: polygon(0 100%, 15% 60%, 30% 75%, 45% 35%, 60% 50%, 75% 20%, 90% 30%, 100% 0%, 100% 100%);
  opacity: 0.15;
  animation: chartGrow 2s var(--ease-out) infinite alternate;
}

.mock-dashboard-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
}

@keyframes chartGrow {
  from { transform: scaleY(0.7); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

/* Solution 2 : Bordereau + CCTP */
.mock-cctp {
  position: absolute;
  inset: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.mock-cctp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 600;
  color: var(--ink);
}

.mock-cctp-header-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  color: var(--ink-muted);
  font-weight: 400;
}

.mock-cctp-line {
  display: grid;
  grid-template-columns: 1fr 50px 30px;
  gap: 6px;
  font-size: 8.5px;
  color: var(--ink-soft);
  align-items: center;
  padding: 1px 0;
  opacity: 0;
  animation: cctpLineIn 0.4s var(--ease-out) forwards;
}

.mock-cctp-line:nth-child(2) { animation-delay: 0.2s; }
.mock-cctp-line:nth-child(3) { animation-delay: 0.5s; }
.mock-cctp-line:nth-child(4) { animation-delay: 0.8s; }
.mock-cctp-line:nth-child(5) { animation-delay: 1.1s; }
.mock-cctp-line:nth-child(6) { animation-delay: 1.4s; }
.mock-cctp-line:nth-child(7) { animation-delay: 1.7s; }

@keyframes cctpLineIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.mock-cctp-line span:nth-child(2),
.mock-cctp-line span:nth-child(3) {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
}

.mock-cctp-progress {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 7.5px;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.mock-cctp-progress-bar {
  flex: 1;
  height: 3px;
  background: var(--bg-soft);
  border-radius: 2px;
  overflow: hidden;
}

.mock-cctp-progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--ink);
  width: 0;
  animation: progressGrow 2.5s var(--ease-out) forwards;
}

@keyframes progressGrow {
  to { width: 78%; }
}

/* Solution 3 : Veille BOAMP */
.mock-boamp {
  position: absolute;
  inset: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.mock-boamp-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border-radius: 5px;
  padding: 5px 8px;
  margin-bottom: 8px;
  font-size: 8.5px;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
}

.mock-boamp-search::before {
  content: '';
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink-muted);
  border-radius: 50%;
  flex-shrink: 0;
}

.mock-boamp-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mock-boamp-item {
  background: var(--bg-soft);
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 8.5px;
  border-left: 2px solid var(--ink);
  opacity: 0;
  animation: boampItemIn 0.5s var(--ease-out) forwards;
}

.mock-boamp-item:nth-child(1) { animation-delay: 0.2s; }
.mock-boamp-item:nth-child(2) { animation-delay: 0.5s; }
.mock-boamp-item:nth-child(3) { animation-delay: 0.8s; }
.mock-boamp-item:nth-child(4) { animation-delay: 1.1s; }

.mock-boamp-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mock-boamp-item-title {
  color: var(--ink);
  font-weight: 500;
  font-size: 8.5px;
}

.mock-boamp-item-meta {
  color: var(--ink-muted);
  font-size: 7.5px;
}

.mock-boamp-score {
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 8px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

@keyframes boampItemIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
