/* ==========================================================================
   GetSyncPeak — reusable code-drawn diagram components
   (phone mockup, browser/dashboard mockup, flow diagram)
   Loaded only on pages that use them — does not touch assets/css/style.css
   ========================================================================== */

/* ---------- shared wrap ---------- */
.demo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 16px;
  background: #f4f5f7;
  border-radius: 16px;
  margin-bottom: 16px;
}

/* ==========================================================================
   1) PHONE MOCKUP — chat bubble / call screen / chatbot conversation
   ========================================================================== */
.phone-demo {
  width: 280px;
  max-width: 100%;
  height: 560px;
  background: #161616;
  border-radius: 40px;
  padding: 14px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .25);
  position: relative;
}
.phone-demo__notch {
  width: 120px;
  height: 20px;
  background: #161616;
  border-radius: 0 0 14px 14px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.phone-demo__screen {
  background: #e9edf3;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-demo__header {
  background: #161616;
  color: #fff;
  text-align: center;
  padding: 16px 12px 10px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-primary);
}
.phone-demo__header span {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: #9aa0a6;
  margin-top: 2px;
}
.phone-demo__body {
  flex: 1;
  padding: 20px 16px;
}

/* -- chat bubble (whatsapp / sms / rcs) -- */
.phone-demo__bubble {
  background: #fff;
  padding: 14px 16px;
  border-radius: 14px 14px 14px 2px;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
  font-family: var(--font-primary);
  color: #242335;
  opacity: 0;
  transform: translateY(14px);
  animation: pdBubble 6s ease-in-out infinite;
}
.phone-demo__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  animation: pdMeta 6s ease-in-out infinite;
}
.phone-demo__time { font-size: 10.5px; color: #9aa0a6; }
.phone-demo__ticks { position: relative; width: 18px; height: 12px; display: inline-block; }
.phone-demo__ticks svg { position: absolute; top: 0; left: 0; width: 18px; height: 12px; }
.phone-demo__ticks .grey { opacity: 0; animation: pdTickGrey 6s ease-in-out infinite; }
.phone-demo__ticks .blue { opacity: 0; animation: pdTickBlue 6s ease-in-out infinite; }

/* -- rcs rich card variant -- */
.phone-demo__card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
  opacity: 0;
  transform: translateY(14px);
  animation: pdBubble 6s ease-in-out infinite;
}
.phone-demo__card-media {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}
.phone-demo__card-body { padding: 12px 14px; font-family: var(--font-primary); }
.phone-demo__card-title { font-size: 13px; font-weight: 700; color: #242335; margin-bottom: 4px; }
.phone-demo__card-desc { font-size: 11.5px; color: #6b7280; margin-bottom: 10px; }
.phone-demo__card-actions { display: flex; border-top: 1px solid #eee; }
.phone-demo__card-actions span {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 10px 0;
  color: var(--phone-accent, #1BA2DB);
}
.phone-demo__card-actions span:first-child { border-right: 1px solid #eee; }

/* -- call / IVR screen variant -- */
.phone-demo__call {
  text-align: center;
  padding-top: 20px;
  font-family: var(--font-primary);
}
.phone-demo__call-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: linear-gradient(137.66deg, #40454A 21.13%, #292C2E 80.53%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
}
.phone-demo__call-name { font-size: 15px; font-weight: 700; color: #242335; }
.phone-demo__call-sub { font-size: 11.5px; color: #6b7280; margin-bottom: 18px; }
.phone-demo__ivr-menu { text-align: left; padding: 0 6px; }
.phone-demo__ivr-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #242335;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
  opacity: 0;
  transform: translateX(-10px);
}
.phone-demo__ivr-option b {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--phone-accent, #1BA2DB);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.phone-demo__ivr-option:nth-child(1) { animation: pdSlideIn 6s ease-in-out infinite; animation-delay: 0s; }
.phone-demo__ivr-option:nth-child(2) { animation: pdSlideIn 6s ease-in-out infinite; animation-delay: .15s; }
.phone-demo__ivr-option:nth-child(3) { animation: pdSlideIn 6s ease-in-out infinite; animation-delay: .3s; }

/* -- chatbot conversation variant -- */
.phone-demo__chat-row { display: flex; margin-bottom: 12px; }
.phone-demo__chat-row.bot { justify-content: flex-start; }
.phone-demo__chat-row.user { justify-content: flex-end; }
.phone-demo__chat-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.45;
  font-family: var(--font-primary);
  opacity: 0;
  transform: translateY(10px);
}
.phone-demo__chat-row.bot .phone-demo__chat-bubble {
  background: #fff;
  color: #242335;
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
  animation: pdChatBot 6s ease-in-out infinite;
}
.phone-demo__chat-row.user .phone-demo__chat-bubble {
  background: var(--phone-accent, #98FF03);
  color: #10230b;
  border-bottom-right-radius: 2px;
  animation: pdChatUser 6s ease-in-out infinite;
}
.phone-demo__typing {
  display: inline-flex;
  gap: 3px;
  background: #fff;
  padding: 10px 13px;
  border-radius: 13px;
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
  opacity: 0;
  animation: pdTyping 6s ease-in-out infinite;
}
.phone-demo__typing span {
  width: 5px; height: 5px; border-radius: 50%; background: #9aa0a6;
  animation: pdDot 1s ease-in-out infinite;
}
.phone-demo__typing span:nth-child(2) { animation-delay: .15s; }
.phone-demo__typing span:nth-child(3) { animation-delay: .3s; }

/* -- status line (sending / delivered / read) shared by chat + card variants -- */
.phone-demo__status-wrap {
  position: relative;
  height: 20px;
  margin-top: auto;
  padding-bottom: 18px;
  font-family: var(--font-primary);
}
.phone-demo__status {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
}
.phone-demo__status.s1 { color: #9aa0a6; animation: pdStatus1 6s ease-in-out infinite; }
.phone-demo__status.s2 { color: #4a4f57; animation: pdStatus2 6s ease-in-out infinite; }
.phone-demo__status.s3 { color: var(--phone-accent, #25D366); animation: pdStatus3 6s ease-in-out infinite; }

/* color themes */
.phone-demo--whatsapp { --phone-accent: #25D366; }
.phone-demo--sms { --phone-accent: #FF8F3C; }
.phone-demo--rcs { --phone-accent: #1BA2DB; }
.phone-demo--rcs .phone-demo__card-media { background: linear-gradient(135deg, #1BA2DB, #6fd0ff); }
.phone-demo--ai { --phone-accent: #98FF03; }
.phone-demo--voice { --phone-accent: #1BA2DB; }

@keyframes pdBubble { 0% { opacity: 0; transform: translateY(14px); } 10%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes pdMeta { 0%, 12% { opacity: 0; } 20%, 100% { opacity: 1; } }
@keyframes pdTickGrey { 0%, 20% { opacity: 0; } 28%, 100% { opacity: 1; } }
@keyframes pdTickBlue { 0%, 55% { opacity: 0; } 65%, 100% { opacity: 1; } }
@keyframes pdStatus1 { 0%, 10% { opacity: 0; } 18%, 32% { opacity: 1; } 42% { opacity: 0; } }
@keyframes pdStatus2 { 0%, 35% { opacity: 0; } 42%, 58% { opacity: 1; } 68% { opacity: 0; } }
@keyframes pdStatus3 { 0%, 62% { opacity: 0; } 70%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pdSlideIn { 0%, 8% { opacity: 0; transform: translateX(-10px); } 22%, 100% { opacity: 1; transform: translateX(0); } }
@keyframes pdChatBot { 0%, 8% { opacity: 0; transform: translateY(10px); } 18%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes pdTyping { 0%, 32% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes pdChatUser { 0%, 46% { opacity: 0; transform: translateY(10px); } 56%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes pdDot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-3px); opacity: 1; } }

/* ==========================================================================
   2) BROWSER / DASHBOARD MOCKUP — inbox / omnichannel dashboard
   ========================================================================== */
.browser-demo {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .15);
}
.browser-demo__bar {
  background: #f1f2f4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.browser-demo__bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.browser-demo__bar i:nth-child(1) { background: #ff5f57; }
.browser-demo__bar i:nth-child(2) { background: #febc2e; }
.browser-demo__bar i:nth-child(3) { background: #28c840; }
.browser-demo__url {
  margin-left: 12px;
  background: #fff;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px;
  color: #6b7280;
  font-family: var(--font-primary);
}
.browser-demo__body { padding: 18px; font-family: var(--font-primary); }
.inbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f9fafb;
  opacity: 0;
  transform: translateX(-8px);
  animation: rowIn .5s ease forwards;
}
.inbox-row:nth-child(1) { animation-delay: .1s; }
.inbox-row:nth-child(2) { animation-delay: .25s; }
.inbox-row:nth-child(3) { animation-delay: .4s; }
.inbox-row:nth-child(4) { animation-delay: .55s; }
.inbox-row__channel {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 700;
}
.inbox-row__channel.whatsapp { background: #25D366; }
.inbox-row__channel.sms { background: #FF8F3C; }
.inbox-row__channel.email { background: #1BA2DB; }
.inbox-row__channel.voice { background: #6b6f76; }
.inbox-row__channel.rcs { background: #6a5cff; }
.inbox-row__content { flex: 1; min-width: 0; }
.inbox-row__top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-row__name { font-size: 12.5px; font-weight: 700; color: #242335; }
.inbox-row__time { font-size: 10.5px; color: #9aa0a6; white-space: nowrap; }
.inbox-row__preview {
  font-size: 11.5px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-row__badge {
  background: var(--color-primary, #98FF03); color: #10230b;
  font-size: 10px; font-weight: 700; border-radius: 20px; padding: 2px 7px; flex-shrink: 0;
}
@keyframes rowIn { to { opacity: 1; transform: translateX(0); } }

/* email client variant */
.email-demo__list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.email-demo__item {
  padding: 10px 12px; border-radius: 8px; font-size: 11.5px; color: #6b7280;
  border-left: 3px solid transparent;
}
.email-demo__item.active { background: #eef6ff; border-left-color: #1BA2DB; color: #242335; font-weight: 700; }
.email-demo__preview {
  border-top: 1px solid #eee; margin-top: 10px; padding-top: 14px;
  opacity: 0; transform: translateY(10px); animation: pdBubble 6s ease-in-out infinite;
}
.email-demo__subject { font-size: 13.5px; font-weight: 700; color: #242335; margin-bottom: 6px; }
.email-demo__body-text { font-size: 11.5px; color: #6b7280; line-height: 1.6; }
.email-demo__cta {
  display: inline-block; margin-top: 10px; background: #1BA2DB; color: #fff;
  font-size: 11px; font-weight: 700; padding: 8px 16px; border-radius: 8px;
}

/* ==========================================================================
   3) FLOW DIAGRAM — animated step flow (automation / how-it-works)
   ========================================================================== */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  width: 100%;
  max-width: 880px;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 140px;
  text-align: center;
}
.flow-step__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .1);
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: scale(.8);
  animation: flowIcon 5s ease-in-out infinite;
}
.flow-step__label { font-family: var(--font-primary); font-size: 12.5px; font-weight: 700; color: #242335; }
.flow-step__sub { font-family: var(--font-primary); font-size: 10.5px; color: #9aa0a6; }
.flow-arrow {
  width: 56px;
  height: 2px;
  background: repeating-linear-gradient(90deg, #cfd3da 0 6px, transparent 6px 12px);
  position: relative;
  margin: 0 4px 26px;
  flex-shrink: 0;
}
.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  width: 0; height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #cfd3da;
}
.flow-arrow .dot {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary, #98FF03);
  opacity: 0;
  animation: flowDot 5s ease-in-out infinite;
}
.flow-step:nth-child(1) .flow-step__icon { animation-delay: 0s; }
.flow-step:nth-child(3) .flow-step__icon { animation-delay: .3s; }
.flow-step:nth-child(5) .flow-step__icon { animation-delay: .6s; }
.flow-step:nth-child(7) .flow-step__icon { animation-delay: .9s; }
.flow-diagram .flow-arrow:nth-of-type(2) .dot { animation-delay: .15s; }
.flow-diagram .flow-arrow:nth-of-type(4) .dot { animation-delay: .45s; }
.flow-diagram .flow-arrow:nth-of-type(6) .dot { animation-delay: .75s; }

@keyframes flowIcon { 0%, 100% { opacity: 1; transform: scale(1); } }
@keyframes flowDot { 0%, 10% { opacity: 0; left: 0; } 15% { opacity: 1; } 45% { opacity: 1; left: calc(100% - 8px); } 50%, 100% { opacity: 0; left: calc(100% - 8px); } }

/* ==========================================================================
   4) STAT CARD — compact fixed-height highlight (fits the "Two Images Row"
      / gallery slots that expect a specific box height)
   ========================================================================== */
.stat-card {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  border-radius: 16px;
  padding: 24px;
  font-family: var(--font-primary);
  color: #fff;
  background: linear-gradient(137.66deg, #40454A 21.13%, #292C2E 80.53%);
}
.stat-card__icon { font-size: 30px; margin-bottom: 4px; }
.stat-card__number {
  font-family: var(--font-secondary, var(--font-primary));
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--stat-accent, #98FF03);
}
.stat-card__label { font-size: 13px; color: rgba(255, 255, 255, .75); max-width: 200px; }
.stat-card--light {
  background: #fff;
  color: #242335;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
  border: 1px solid rgba(3, 7, 18, .08);
}
.stat-card--light .stat-card__label { color: #6b7280; }

@media (max-width: 767px) {
  .flow-diagram { flex-direction: column; }
  .flow-arrow { width: 2px; height: 32px; margin: 0 0 0; background: repeating-linear-gradient(180deg, #cfd3da 0 6px, transparent 6px 12px); }
  .flow-arrow::after { right: -3px; top: auto; bottom: -1px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 6px solid #cfd3da; border-bottom: 0; }
  .flow-arrow .dot { left: 50% !important; transform: translateX(-50%); animation-name: flowDotV; }
  @keyframes flowDotV { 0%, 10% { opacity: 0; top: 0; } 15% { opacity: 1; } 45% { opacity: 1; top: calc(100% - 8px); } 50%, 100% { opacity: 0; top: calc(100% - 8px); } }
}
