.chat-demo-section {
  position: relative;
}

.chat-demo-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.22), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(168, 85, 247, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(10, 16, 38, 0.86), rgba(13, 17, 35, 0.65));
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 25px 45px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(125, 211, 252, 0.08);
  backdrop-filter: blur(14px);
}

.chat-demo-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0.7px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.06;
}

.chat-demo-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(14, 116, 144, 0.12);
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c7e8ff;
}

.chat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chat-tab {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  background: rgba(15, 23, 42, 0.5);
  color: #d9e8ff;
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.chat-tab.is-active,
.chat-tab:hover {
  border-color: rgba(125, 211, 252, 0.7);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.34), rgba(139, 92, 246, 0.26));
  box-shadow: 0 10px 22px rgba(56, 189, 248, 0.15);
}

.chat-demo-layout {
  display: grid;
  grid-template-columns: minmax(235px, 290px) 1fr;
  gap: 1rem;
}

.chat-conversation-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-conversation-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.95rem;
  padding: 0.8rem;
  background: rgba(15, 23, 42, 0.42);
  transition: all 0.22s ease;
}

.chat-conversation-card.is-highlighted {
  border-color: rgba(125, 211, 252, 0.58);
  box-shadow: 0 12px 28px rgba(14, 116, 144, 0.22);
  transform: translateY(-1px);
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.chat-meta strong {
  font-size: 0.92rem;
}

.chat-meta time {
  font-size: 0.72rem;
  color: #94a3b8;
}

.chat-status {
  display: inline-flex;
  margin-top: 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.55rem;
}

.chat-status.new {
  color: #a5f3fc;
  border-color: rgba(34, 211, 238, 0.45);
}

.chat-status.progress {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.45);
}

.chat-status.closed {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.45);
}

.chat-window {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(2, 6, 23, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 15px 25px rgba(15, 23, 42, 0.45);
  min-height: 430px;
  display: flex;
  flex-direction: column;
}

.chat-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.45);
  background: rgba(22, 163, 74, 0.16);
  color: #bbf7d0;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
}

.chat-status-dot::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #86efac;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.85);
}

.chat-messages {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 330px;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  opacity: 0;
  transform: translateY(8px);
  animation: msg-in 340ms ease forwards;
}

.chat-message.is-user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #bfdbfe;
  flex-shrink: 0;
}

.chat-avatar img {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
}

.chat-bubble {
  max-width: min(78%, 500px);
  border-radius: 0.9rem;
  padding: 0.62rem 0.8rem;
  font-size: 0.92rem;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.68);
}

.chat-message.is-user .chat-bubble {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.34), rgba(6, 182, 212, 0.22));
  border-color: rgba(56, 189, 248, 0.42);
}

.chat-typing {
  padding: 0.15rem 1rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.chat-typing-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.chat-typing-dots i {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: #67e8f9;
  animation: pulse 1s ease-in-out infinite;
}

.chat-typing-dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dots i:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.95rem;
}

.chat-action-chip {
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
  color: #bfdbfe;
  background: rgba(15, 23, 42, 0.6);
}

.chat-demo-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 0.6rem;
  padding: 0.85rem 1rem 1rem;
}

.chat-demo-footer button[disabled],
.chat-demo-footer input[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.chat-demo-cta {
  text-align: center;
}

@keyframes msg-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 920px) {
  .chat-demo-layout {
    grid-template-columns: 1fr;
  }
}
