.tc-chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  font-family: "Be Vietnam Pro", sans-serif;
}
.tc-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a56db 0%, #0b2163 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(26, 86, 219, 0.45);
  color: #fff;
  font-size: 1.5rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 10001;
  position: relative;
  animation: tc-bubble-pulse 2s infinite;
}
@keyframes tc-bubble-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(26, 86, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0);
  }
}
.tc-bubble:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 14px 32px rgba(26, 86, 219, 0.55);
}
.tc-bubble-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e02424;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  animation: tc-pulse 2s infinite;
}
.tc-bubble-badge.hidden {
  display: none;
}
@keyframes tc-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}
.tc-fab-menu {
  position: absolute;
  bottom: 76px;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 260px;
  display: flex;
  flex-direction: column;
  padding: 0 0 8px;
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease;
  z-index: 1001;
  overflow: hidden;
}
.tc-fab-menu.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: all;
}
.tc-fab-menu::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 20px;
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
  display: block;
  width: 0;
}
.tc-fab-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.tc-fab-item:hover {
  background: #f3f4f6;
}
.tc-fab-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.tc-fab-icon.chat {
  background: linear-gradient(135deg, #1a56db 0%, #0b2163 100%);
}
.tc-fab-icon.zalo {
  background: #0068ff;
}
.tc-fab-icon.call {
  background: #059669;
}
.tc-fab-icon.messenger {
  background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
}
.tc-chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  height: 520px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0) translateY(10px);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease;
  pointer-events: none;
}
.tc-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}
.tc-header {
  background: linear-gradient(135deg, #1a56db 0%, #0b2163 100%);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.tc-header-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}
.tc-header-info {
  flex: 1;
}
.tc-header-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
}
.tc-header-status {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
}
.tc-status-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: tc-pulse 1.5s infinite;
}
.tc-minimize {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.tc-minimize:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.tc-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scroll-behavior: smooth;
}
.tc-body::-webkit-scrollbar {
  width: 4px;
}
.tc-body::-webkit-scrollbar-track {
  background: transparent;
}
.tc-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.tc-msg {
  display: flex;
  gap: 0.5rem;
  max-width: 85%;
  animation: tc-msg-in 0.25s ease;
}
@keyframes tc-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tc-msg.bot,
.tc-msg.staff {
  align-self: flex-start;
}
.tc-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.tc-msg-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: auto;
}
.tc-msg.bot .tc-msg-icon {
  background: #eef3ff;
  color: #1a56db;
}
.tc-msg.staff .tc-msg-icon {
  background: #ecfdf5;
  color: #059669;
}
.tc-msg.user .tc-msg-icon {
  background: #1a56db;
  color: #fff;
}
.tc-msg-bubble {
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.tc-msg.bot .tc-msg-bubble {
  background: #fff;
  color: #374151;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.tc-msg.staff .tc-msg-bubble {
  background: #d1fae5;
  color: #065f46;
  border-bottom-left-radius: 4px;
}
.tc-msg.user .tc-msg-bubble {
  background: #1a56db;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.tc-msg-time {
  font-size: 0.65rem;
  color: #9ca3af;
  margin-top: 0.2rem;
  text-align: right;
}
.tc-msg.bot .tc-msg-time,
.tc-msg.staff .tc-msg-time {
  text-align: left;
}
.chat-link {
  color: #1a56db;
  text-decoration: underline;
}
.tc-msg.user .chat-link {
  color: #bfdbfe;
}
.tc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.tc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: #eef3ff;
  color: #1a56db;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tc-chip:hover {
  background: #1a56db;
  color: #fff;
  border-color: #1a56db;
}
.tc-staff-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: #6b7280;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  margin: 0.5rem 0;
}
.tc-staff-btn:hover {
  background: #f1f5f9;
  color: #374151;
  border-color: #94a3b8;
}
.tc-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.tc-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}
.tc-input:focus {
  border-color: #1a56db;
}
.tc-input::placeholder {
  color: #9ca3af;
}
.tc-send {
  width: 38px;
  height: 38px;
  background: #1a56db;
  color: #fff;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tc-attach {
  width: 38px;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.tc-read {
  font-size: 0.62rem;
  color: #94a3b8;
  text-align: right;
  margin-top: 2px;
}
.tc-send:hover {
  background: #1035a0;
  transform: scale(1.05);
}
.tc-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}
.tc-typing {
  display: none;
  align-self: flex-start;
}
.tc-typing.show {
  display: flex;
}
.tc-typing-dots {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 0.6rem 0.85rem;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.tc-dot {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: tc-bounce 0.8s infinite;
}
.tc-dot:nth-child(2) {
  animation-delay: 0.15s;
}
.tc-dot:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes tc-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
    background: #1a56db;
  }
}
.tc-staff-banner {
  background: #d1fae5;
  color: #065f46;
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid #a7f3d0;
}
.tc-staff-banner.show {
  display: flex;
}
.tc-bubble.dragging {
  opacity: 0.8;
  transform: scale(1.05);
  cursor: grabbing;
}
@media (max-width: 480px) {
  .tc-chat-window {
    width: calc(100vw - 32px) !important;
    height: calc(100vh - 140px) !important;
    max-height: 520px;
    bottom: 76px !important;
  }
  .tc-chat-widget {
    bottom: 16px !important;
    right: 16px !important;
  }
}
