/* CloudFixies — Teams chatbot animated demo (CSS-driven "screen recording") */

/* Full container mimics Teams window chrome */
.tv-mock {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: #F5F5F5;
  box-shadow: var(--shadow-brut);
  position: relative;
  aspect-ratio: 16/10;
  color: #242424;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.tv-mock.dark { background: #1F1F1F; color: #F0F0F0; }

.tv-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #EBEBEB;
  border-bottom: 1px solid #D5D5D5;
  font-size: 12px;
}
.tv-dots { display: inline-flex; gap: 6px; }
.tv-dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tv-dots i:nth-child(1) { background: #FF605C; }
.tv-dots i:nth-child(2) { background: #FFBD44; }
.tv-dots i:nth-child(3) { background: #00CA4E; }
.tv-url { flex: 1; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #666; }
.tv-teams-badge { background: #4b53bc; color: #fff; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; }

.tv-body {
  display: grid; grid-template-columns: 60px 1fr;
  height: calc(100% - 34px);
}
.tv-rail {
  background: #F0F0F0;
  border-right: 1px solid #D5D5D5;
  display: flex; flex-direction: column; align-items: center; padding-top: 12px; gap: 14px;
}
.tv-rail-item { width: 32px; height: 32px; border-radius: 6px; background: #ddd; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #666; }
.tv-rail-item.active { background: #4b53bc; color: #fff; box-shadow: -3px 0 0 #4b53bc inset; border-radius: 6px; }

.tv-chat {
  padding: 14px 16px 8px;
  overflow-y: hidden;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  height: 100%;
}
.tv-chat-header {
  padding-bottom: 10px; margin-bottom: 4px;
  border-bottom: 1px solid #E0E0E0;
  display: flex; align-items: center; gap: 10px;
}
.tv-chat-header .av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--acc-blue), var(--acc-mag)); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.tv-chat-header .name { font-weight: 700; font-size: 13.5px; }
.tv-chat-header .status { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #666; }
.tv-chat-header .status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #00A72F; display: inline-block; }

.tv-msgs {
  flex: 1;
  overflow-y: hidden;
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 4px;
}
.tv-msg {
  display: flex; gap: 8px; align-items: flex-start;
  max-width: 78%;
  opacity: 0;
  transform: translateY(6px);
  animation-fill-mode: forwards;
}
.tv-msg.user { align-self: flex-end; flex-direction: row-reverse; max-width: 65%; }
.tv-msg .a { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: #fff; margin-top: 2px; }
.tv-msg .a.bot { background: linear-gradient(135deg, var(--acc-blue), var(--acc-mag)); }
.tv-msg .a.user { background: #616161; }
.tv-msg .bubble {
  background: #F5F5F5;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.35;
}
.tv-msg.user .bubble { background: #EDEBFF; border-color: #D5D2F5; }
.tv-msg .bubble b { font-weight: 700; }
.tv-msg .bubble .chip { display: inline-block; padding: 1px 6px; border-radius: 3px; font-family: 'JetBrains Mono', monospace; font-size: 10px; background: #E0F5E9; color: #006632; }
.tv-msg .bubble .chip.blue { background: #E6EEFF; color: #003BFF; }
.tv-msg .bubble .chip.rust { background: #FFEDE0; color: #C2410C; }

/* Adaptive Card for approvals */
.tv-card {
  background: #ffffff;
  border: 1px solid #E0E0E0;
  border-left: 4px solid var(--acc-blue);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
}
.tv-card h5 { margin: 0 0 4px; font-size: 12.5px; font-weight: 700; }
.tv-card .row { display: flex; justify-content: space-between; padding: 2px 0; color: #444; }
.tv-card .actions { display: flex; gap: 6px; margin-top: 8px; }
.tv-card .btn { padding: 4px 12px; font-size: 11px; font-weight: 600; border-radius: 4px; border: 1px solid #ccc; background: #fff; }
.tv-card .btn.primary { background: #4b53bc; color: #fff; border-color: #4b53bc; }

/* Typing indicator */
.tv-typing { display: inline-flex; gap: 3px; padding: 4px 6px; }
.tv-typing i { width: 5px; height: 5px; border-radius: 50%; background: #888; display: inline-block; animation: tv-dot 1.2s infinite; }
.tv-typing i:nth-child(2) { animation-delay: 0.2s; }
.tv-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes tv-dot { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* Recording pill */
.tv-rec {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  background: rgba(8,8,13,0.85);
  color: #fff;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
}
.tv-rec::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #FF3B30; animation: tv-rec 1.4s ease-in-out infinite; }
@keyframes tv-rec { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* -------- Loop timeline: 20s total -------- */
@keyframes tv-in { to { opacity: 1; transform: translateY(0); } }
@keyframes tv-out { to { opacity: 0; transform: translateY(-8px); } }

.tv-msg { animation: tv-in 400ms both, tv-out 400ms 19s both; }
.tv-msg.m1 { animation-delay: 0.8s, 19s; }
.tv-msg.m2 { animation-delay: 2.4s, 19s; }
.tv-msg.m3 { animation-delay: 4.4s, 19s; }
.tv-msg.m4 { animation-delay: 6.6s, 19s; }
.tv-msg.m5 { animation-delay: 8.6s, 19s; }
.tv-msg.m6 { animation-delay: 11.0s, 19s; }
.tv-msg.m7 { animation-delay: 13.2s, 19s; }
.tv-msg.m8 { animation-delay: 15.6s, 19s; }

/* Loop the whole thing */
.tv-chat .tv-msgs { animation: tv-restart 20s infinite; }
@keyframes tv-restart { 0%,99.9% { transform: none; } 100% { transform: none; } }

/* Actually restart via the elements themselves — animation-iteration: infinite on each msg */
.tv-msg {
  animation-iteration-count: infinite;
  animation-duration: 400ms, 400ms;
  animation-name: tv-in, tv-out;
}
/* Cadence with 20s cycle — use single animation combining fade-in-hold-fade-out */
.tv-msg {
  animation: tv-cycle 20s infinite both;
}
@keyframes tv-cycle {
  0%   { opacity: 0; transform: translateY(6px); }
  3%   { opacity: 1; transform: translateY(0); }
  92%  { opacity: 1; transform: translateY(0); }
  96%  { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 0; }
}
/* Per-message stagger via animation-delay (negative delays start in past for the first cycle) */
.tv-msg.m1 { animation-delay: -0s; }
.tv-msg.m2 { animation-delay: -18.4s; }  /* start 1.6s into next cycle */
.tv-msg.m3 { animation-delay: -16.4s; }
.tv-msg.m4 { animation-delay: -14.4s; }
.tv-msg.m5 { animation-delay: -12.4s; }
.tv-msg.m6 { animation-delay: -9.9s; }
.tv-msg.m7 { animation-delay: -7.5s; }
.tv-msg.m8 { animation-delay: -5s; }

@media (prefers-reduced-motion: reduce) {
  .tv-msg { animation: none; opacity: 1; transform: none; }
}
