/* ═══════════════════════════════════════
   HELIA — uchat.css
   Unified Chat Canvas Animation
═══════════════════════════════════════ */

#S-UCHAT {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--c);
}

#S-UCHAT canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ── TOP TEXT ── */
.UC-TOP {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  text-align: center;
  padding: 64px 44px 0;
}
.UC-EY {
  font-family: var(--M);
  font-size: 9px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--m2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.UC-EY::before, .UC-EY::after {
  content: '';
  width: 14px; height: 1px;
  background: var(--m2);
}
.UC-H1 {
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 900;
  letter-spacing: -2.5px;
  line-height: 1;
  margin-bottom: 10px;
}
.UC-H1 .g { color: var(--g) }

/* Text transitions for phase changes */
.UC-EY-TEXT,
.UC-H1,
.UC-H2 {
  transition: opacity .35s ease, transform .35s ease;
}

.UC-H2 {
  font-size: 16px;
  color: var(--m);
  font-weight: 300;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── CENTER APP (purple chat icon) ── */
.UC-APP {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: transform .6s cubic-bezier(.16,1,.3,1);
}
.UC-APP-ICON {
  border-radius: 18px;
  background: linear-gradient(135deg, var(--g), var(--g2));
  box-shadow:
    0 6px 30px rgba(139,92,246,.25),
    0 0 60px rgba(139,92,246,.1),
    0 0 0 1px rgba(139,92,246,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all .8s cubic-bezier(.16,1,.3,1);
}
.UC-APP-ICON::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}
.UC-APP-ICON svg {
  position: relative;
  z-index: 1;
}
.UC-APP-NAME {
  font-family: var(--M);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--g);
  transition: all .6s;
}

/* Glow pulse */
@keyframes ucGlow {
  0%, 100% {
    box-shadow:
      0 6px 30px rgba(139,92,246,.25),
      0 0 60px rgba(139,92,246,.1),
      0 0 0 1px rgba(139,92,246,.15);
  }
  50% {
    box-shadow:
      0 6px 30px rgba(139,92,246,.35),
      0 0 80px rgba(139,92,246,.2),
      0 0 0 1px rgba(139,92,246,.25);
  }
}
.UC-APP-ICON { animation: ucGlow 3s ease-in-out infinite }

/* ── FAKE CURSOR (for click animation) ── */
.UC-CURSOR {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
}
.UC-CURSOR.show { opacity: 1 }
.UC-CUR-DOT {
  position: absolute;
  width: 5px; height: 5px;
  background: var(--k);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.UC-CUR-RING {
  position: absolute;
  width: 32px; height: 32px;
  border: 1.5px solid var(--k);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: .4;
  transition: all .28s cubic-bezier(.16,1,.3,1);
}
.UC-CURSOR.hover .UC-CUR-RING {
  width: 58px; height: 58px;
  opacity: .8;
  border-color: var(--g);
}
.UC-CURSOR.hover .UC-CUR-DOT {
  background: var(--g);
}
.UC-CURSOR.click .UC-CUR-RING {
  width: 16px; height: 16px;
  opacity: 1;
}

/* ── CHAT OVERLAY ── */
.UC-CHAT-WRAP {
  position: absolute;
  z-index: 15;
  opacity: 0;
  transform: scale(0);
  transition: all .5s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.UC-CHAT-WRAP.show {
  opacity: 1;
  transform: scale(1);
}

.UC-CHAT {
  width: min(380px, 50vw);
  height: min(480px, 58vh);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 12px 44px rgba(0,0,0,.08), 0 0 80px rgba(139,92,246,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat header */
.UC-C-HEAD {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  flex-shrink: 0;
}
.UC-C-FIRM-AV {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--c2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--g); flex-shrink: 0;
}
.UC-C-INFO { flex: 1 }
.UC-C-FIRM { font-size: 10px; color: var(--m) }
.UC-C-NAME { font-size: 14px; font-weight: 800 }
.UC-C-META { display: flex; gap: 6px; flex-shrink: 0; align-items: center }
.UC-C-CASE {
  padding: 2px 8px; border-radius: 5px;
  font-family: var(--M); font-size: 8px; font-weight: 600;
  background: rgba(34,197,94,.07); color: #22c55e;
  border: 1px solid rgba(34,197,94,.1);
}
.UC-C-PEOPLE { display: flex; margin-left: 4px }
.UC-C-PAV {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; margin-left: -6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 8px;
}
.UC-C-PAV:first-child { margin-left: 0 }

/* Filters */
.UC-FILTERS {
  padding: 7px 12px;
  background: #faf8f4;
  border-bottom: 1px solid rgba(0,0,0,.03);
  display: flex; gap: 3px; align-items: center; flex-wrap: nowrap;
  flex-shrink: 0;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  opacity: 0; max-height: 0;
  transition: all .5s cubic-bezier(.16,1,.3,1);
}
.UC-FILTERS::-webkit-scrollbar { display: none }
.UC-FILTERS.show { opacity: 1; max-height: 34px }
.UC-FT {
  padding: 3px 8px; border-radius: 5px;
  font-size: 8px; font-weight: 600;
  background: rgba(0,0,0,.03); color: var(--m);
  transition: all .3s; border: 1px solid transparent; cursor: default;
}
.UC-FT.on { background: var(--k); color: #fff; border-color: var(--k) }
.UC-FT.glow { border-color: var(--g); box-shadow: 0 0 0 2px rgba(139,92,246,.12); transform: scale(1.06) }
.UC-FT-WA.on { background: #25d366; border-color: #25d366 }
.UC-FT-MAIL.on { background: #ea4335; border-color: #ea4335 }
.UC-FT-SMS.on { background: #3b82f6; border-color: #3b82f6 }
.UC-FT-TG.on { background: #229ED9; border-color: #229ED9 }
.UC-FT-SLACK.on { background: #4A154B; border-color: #4A154B }
.UC-FT-SEP { width: 1px; height: 14px; background: rgba(0,0,0,.06); margin: 0 2px; flex-shrink: 0 }
.UC-FT { flex-shrink: 0; white-space: nowrap }

/* Messages */
.UC-MSGS { flex: 1; overflow-y: auto; padding: 10px 12px; scrollbar-width: none }
.UC-MSGS::-webkit-scrollbar { display: none }
.UC-MSG {
  display: flex; gap: 8px; margin-bottom: 8px;
  transition: all .35s cubic-bezier(.16,1,.3,1);
  opacity: 1; max-height: 140px; transform-origin: top;
}
.UC-MSG.hidden { opacity: 0; max-height: 0; margin: 0; overflow: hidden; transform: scaleY(0) }
.UC-MSG.enter { animation: ucMsgIn .4s cubic-bezier(.16,1,.3,1) forwards; opacity: 0; transform: translateY(6px) }
@keyframes ucMsgIn { to { opacity: 1; transform: translateY(0) } }
.UC-MSG.in { flex-direction: row }
.UC-MSG.in .UC-BUB { margin-right: 32px }
.UC-MSG.out-dir { flex-direction: row-reverse }
.UC-MSG.out-dir .UC-BUB { margin-left: 32px; background: var(--k); color: #fff; border-bottom-right-radius: 4px; border-bottom-left-radius: 12px }
.UC-MSG.out-dir .UC-BUB .UC-B-SENDER { color: rgba(255,255,255,.5) }
.UC-MSG.out-dir .UC-BUB .UC-B-ROLE { color: rgba(255,255,255,.3) }
.UC-MSG.out-dir .UC-BUB .UC-B-TEXT { color: rgba(255,255,255,.9) }
.UC-MSG.out-dir .UC-BUB .UC-B-TIME { color: rgba(255,255,255,.25) }
.UC-MSG.out-dir .UC-BUB .UC-CH-BADGE { opacity: .7 }
.UC-MSG.out-dir .UC-BUB .UC-P-TAG { background: rgba(255,255,255,.1); color: rgba(255,255,255,.5) }
.UC-AV {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 10px;
}
.UC-BUB {
  max-width: 80%; padding: 8px 11px; border-radius: 12px;
  background: #f5f3ee; border-bottom-left-radius: 4px; position: relative;
}
.UC-B-HEAD { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; flex-wrap: wrap }
.UC-CH-BADGE { padding: 1px 5px; border-radius: 3px; font-size: 7px; font-weight: 700; color: #fff; letter-spacing: .3px }
.UC-CH-WA { background: #25d366 }
.UC-CH-MAIL { background: #ea4335 }
.UC-CH-SMS { background: #3b82f6 }
.UC-CH-TG { background: #229ED9 }
.UC-CH-SLACK { background: #4A154B }
.UC-P-TAG { padding: 1px 5px; border-radius: 3px; font-size: 7px; font-weight: 600; background: rgba(139,92,246,.07); color: var(--g) }
.UC-B-SENDER { font-size: 9px; font-weight: 700 }
.UC-B-ROLE { font-weight: 400; color: var(--m); font-size: 9px }
.UC-B-TIME { margin-left: auto; font-family: var(--M); font-size: 7px; color: var(--c4) }
.UC-B-TEXT { font-size: 11px; line-height: 1.55; color: #333; margin-top: 2px }
.UC-B-ATTACH { margin-top: 4px; display: flex; gap: 3px }
.UC-ATT { padding: 2px 6px; border-radius: 4px; font-size: 7px; font-weight: 600; background: rgba(0,0,0,.03); color: var(--m); display: flex; align-items: center; gap: 2px }
.UC-B-READ { font-size: 8px; color: #3b82f6; margin-top: 2px; text-align: right }
.UC-CTX { display: flex; align-items: center; gap: 6px; padding: 4px 0; margin: 2px 0 }
.UC-CTX .ln { flex: 1; height: 1px; background: rgba(0,0,0,.04) }
.UC-CTX .tag { font-size: 7px; font-weight: 600; color: var(--m); padding: 1px 6px; border-radius: 3px; background: rgba(0,0,0,.02) }

/* AI bar */
.UC-AI-BAR {
  margin: 4px 10px 6px; padding: 7px 10px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(139,92,246,.04), rgba(139,92,246,.01));
  border: 1px solid rgba(139,92,246,.07);
  display: flex; align-items: center; gap: 6px;
  opacity: 0; transform: translateY(4px);
  transition: all .4s cubic-bezier(.16,1,.3,1); flex-shrink: 0;
}
.UC-AI-BAR.show { opacity: 1; transform: translateY(0) }
.UC-AI-DOT { width: 5px; height: 5px; border-radius: 50%; background: var(--g); flex-shrink: 0; animation: ucAiDot 1.5s infinite alternate }
@keyframes ucAiDot { from { opacity: .3 } to { opacity: 1 } }
.UC-AI-TEXT { font-size: 9px; color: var(--g); line-height: 1.4; font-weight: 500 }

/* Compose */
.UC-COMPOSE {
  border-top: 1px solid rgba(0,0,0,.04); flex-shrink: 0;
  opacity: 0; max-height: 0; overflow: hidden;
  transition: all .5s cubic-bezier(.16,1,.3,1);
}
.UC-COMPOSE.show { opacity: 1; max-height: 200px }
.UC-COMP-TO { padding: 5px 12px; font-size: 8px; color: var(--m); display: flex; align-items: center; gap: 4px; border-bottom: 1px solid rgba(0,0,0,.02) }
.UC-COMP-TO b { color: var(--k); font-weight: 600 }
.UC-COMP-AVS { display: flex; margin-left: 4px }
.UC-COMP-AV { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #fff; margin-left: -3px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 5px }
.UC-COMP-AV:first-child { margin-left: 0 }
.UC-COMP-INPUT { padding: 8px 12px; font-size: 11px; color: var(--k); min-height: 32px; line-height: 1.5 }
.UC-COMP-INPUT.placeholder { color: var(--m2) }
.UC-COMP-CURSOR { animation: ucBlink .7s infinite }
@keyframes ucBlink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }
.UC-COMP-CHIPS { padding: 3px 10px 5px; display: flex; gap: 4px }
.UC-CHIP { padding: 3px 8px; border-radius: 5px; font-size: 8px; font-weight: 600; background: rgba(34,197,94,.07); color: #22c55e; border: 1px solid rgba(34,197,94,.1) }
.UC-COMP-BAR { padding: 6px 10px; display: flex; align-items: center; gap: 5px; border-top: 1px solid rgba(0,0,0,.03) }
.UC-COMP-I { width: 20px; height: 20px; border-radius: 5px; background: rgba(0,0,0,.03); display: flex; align-items: center; justify-content: center; font-size: 9px }
.UC-COMP-MODE { font-size: 8px; font-weight: 600; color: var(--m); padding: 3px 8px; border-radius: 5px; background: rgba(0,0,0,.02); display: flex; align-items: center; gap: 3px }
.UC-COMP-MODE .md { width: 4px; height: 4px; border-radius: 50%; background: var(--g) }
.UC-COMP-SEND { margin-left: auto; padding: 4px 12px; border-radius: 6px; font-size: 9px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 4px; transition: all .4s ease }
.UC-CS-WA { background: #25d366 }
.UC-CS-MAIL { background: #ea4335 }
.UC-CS-SMS { background: #3b82f6 }
.UC-CS-TG { background: #229ED9 }
.UC-CS-SLACK { background: #4A154B }

/* Profile colors */
.uc-pf-marco { background: linear-gradient(135deg, #667eea, #764ba2) }
.uc-pf-sandra { background: linear-gradient(135deg, #f093fb, #f5576c) }
.uc-pf-thomas { background: linear-gradient(135deg, #4facfe, #00f2fe) }
.uc-pf-noah { background: linear-gradient(135deg, #c8a55c, #9a7b3a) }

@media (max-width: 860px) {
  .UC-TOP { padding: 48px 24px 0 }
  .UC-CHAT { width: min(340px, 85vw); height: min(420px, 50vh) }
}
