/* =========================================================================
   DTC AI COPILOT - STYLE SYSTEM (V3.8.0)
   Designed for BTS-DTC2 Enterprise Webapp
   Palette: DTC Deep Blue (#00428d - #0066b2), Cadmium Accent & Soft Glass
   ========================================================================= */

/* 1. FLOATING ACTION BUTTON (FAB) & VNPT-STYLE AI ASSISTANT */
#dtc-copilot-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1055;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  background: transparent;
}

#dtc-copilot-fab:hover {
  transform: translateY(-2px) scale(1.05);
}

#dtc-copilot-fab:active {
  transform: translateY(0) scale(0.95);
}

/* Avatar Wrapper & Image (Compact, Clean & Sống động) */
.dtc-fab-avatar-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 79, 149, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
  border: 2px solid #ffffff;
  background: #ffffff;
  z-index: 3;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

#dtc-copilot-fab:hover .dtc-fab-avatar-wrapper {
  box-shadow: 0 8px 24px rgba(0, 91, 170, 0.5), 0 2px 8px rgba(0, 0, 0, 0.18);
  border-color: #e0f2fe;
}

.dtc-fab-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  transform-origin: 50% 65%;
  animation: dtc-avatar-head-alive 6.8s ease-in-out infinite;
}

/* Nghiêng nhẹ đầu tự nhiên kết hợp nhịp thở tạo cảm giác sống động, thân thiện */
@keyframes dtc-avatar-head-alive {
  0%, 100% {
    transform: rotate(0deg) scale(1) translateY(0);
  }
  15% {
    transform: rotate(0.4deg) scale(1.01) translateY(-0.8px);
  }
  28%, 52% {
    /* Khi liếc sang phải: đầu khẽ nghiêng 1.2° sang phải theo hướng mắt */
    transform: rotate(1.2deg) scale(1.015) translateY(-0.4px);
  }
  58%, 80% {
    /* Khi liếc sang trái: đầu khẽ nghiêng -0.8° sang trái theo hướng mắt */
    transform: rotate(-0.8deg) scale(1.01) translateY(0.3px);
  }
  86% {
    /* Khi chớp mắt: đầu khẽ gật nhẹ chào đón */
    transform: rotate(0deg) scale(1.005) translateY(0.5px);
  }
}

/* Lớp phủ đôi mắt sống động trên Avatar FAB (Đạt chuẩn chân thực cao nhất) */
.dtc-avatar-eyes-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

/* Hốc mắt với hình quả hạnh nhân (Almond Eye Socket) */
.dtc-avatar-eye-socket {
  position: absolute;
  overflow: hidden;
  border-radius: 50% 50% 45% 45%;
  background: transparent;
}

.dtc-avatar-eye-left {
  left: 38.6%;
  top: 30.8%;
  width: 11.2%;
  height: 6.0%;
}

.dtc-avatar-eye-right {
  left: 53.6%;
  top: 30.2%;
  width: 11.0%;
  height: 6.0%;
}

/* Nhãn cầu mắt (Eyeball / Sclera) */
.dtc-avatar-eyeball {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(60, 40, 30, 0.35);
}

/* Con ngươi & tròng đen mắt (Iris & Pupil) */
.dtc-avatar-iris {
  position: absolute;
  width: 65%;
  height: 96%;
  top: 2%;
  left: 17.5%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ffffff 12%, #633e2b 32%, #2e1a12 65%, #150904 95%);
  box-shadow: 0 0 1.5px rgba(0, 0, 0, 0.65);
  animation: dtc-avatar-iris-sequence 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

/* Đốm sáng phản chiếu ánh mắt long lanh (Catchlight Glints) */
.dtc-avatar-glint-main {
  position: absolute;
  top: 18%;
  left: 24%;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 2px #ffffff;
}

.dtc-avatar-glint-sub {
  position: absolute;
  bottom: 22%;
  right: 26%;
  width: 16%;
  height: 16%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

/* Trình tự ánh mắt liếc nhìn tự nhiên (8s chu kỳ chuẩn): Nhìn thẳng -> Liếc phải -> Liếc trái -> Nhìn thẳng */
@keyframes dtc-avatar-iris-sequence {
  0%, 26% {
    /* Hình 1: Mở to nhìn thẳng tươi cười đón tiếp người dùng */
    transform: translate(0, 0);
  }
  28%, 52% {
    /* Hình 2: Liếc sang bên phải quan sát khung chat / thông tin */
    transform: translate(2.2px, 0.3px);
  }
  54%, 56% {
    transform: translate(0, 0);
  }
  58%, 82% {
    /* Hình 4: Liếc sang bên trái quan sát dữ liệu / người dùng */
    transform: translate(-2.2px, 0.2px);
  }
  84%, 100% {
    /* Trở về nhìn thẳng mỉm cười */
    transform: translate(0, 0);
  }
}

/* Mí mắt khép xuống khi nhắm mắt / chớp mắt (Hình 3 chuẩn thanh tú) */
.dtc-avatar-eyelid {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #fceddf 0%, #f4ded0 60%, #eed2be 100%);
  transform: translateY(-102%);
  pointer-events: none;
  animation: dtc-avatar-eyelid-sequence 8s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

/* Hàng mi cong mềm mại khép lại khi nhắm mắt */
.dtc-avatar-lash {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-bottom: 2px solid #2b170e;
  border-radius: 0 0 50% 50%;
  box-shadow: 0 1px 1.5px rgba(43, 23, 14, 0.35);
}

/* Trình tự nhắm / chớp mắt tự nhiên (Hình 3 chuẩn) */
@keyframes dtc-avatar-eyelid-sequence {
  0%, 25.5% {
    transform: translateY(-102%); /* Mắt mở hoàn toàn */
  }
  26%, 27.5% {
    transform: translateY(0%);    /* Hình 3: Nhắm mắt chớp nhẹ tự nhiên 0.15s */
  }
  28%, 55.5% {
    transform: translateY(-102%); /* Mắt mở hoàn toàn */
  }
  56%, 57.5% {
    transform: translateY(0%);    /* Hình 3: Nhắm mắt chớp chuyển hướng nhìn */
  }
  58%, 84.5% {
    transform: translateY(-102%); /* Mắt mở hoàn toàn */
  }
  85%, 86.5% {
    transform: translateY(0%);    /* Hình 3: Nhắm mắt chớp nhẹ nhã nhặn */
  }
  87%, 100% {
    transform: translateY(-102%); /* Mắt mở nhìn thẳng */
  }
}

/* Vòng tròn lan tỏa màu xanh thương hiệu DTC (Concentric Circular Ripples) */
.dtc-ripple-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(0, 91, 170, 0.7);
  background: radial-gradient(circle, rgba(0, 91, 170, 0.08) 0%, rgba(0, 91, 170, 0) 70%);
  pointer-events: none;
  z-index: 1;
  animation: dtc-blue-ripple 3.2s cubic-bezier(0.2, 0.8, 0.25, 1) infinite;
}

.dtc-ripple-ring-1 {
  animation-delay: 0s;
}

.dtc-ripple-ring-2 {
  animation-delay: 1.05s;
}

.dtc-ripple-ring-3 {
  animation-delay: 2.1s;
}

@keyframes dtc-blue-ripple {
  0% {
    opacity: 0.85;
    border-width: 2px;
    border-color: rgba(0, 91, 170, 0.75);
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 0.45;
    border-color: rgba(0, 102, 178, 0.45);
  }

  100% {
    opacity: 0;
    border-width: 1px;
    border-color: rgba(0, 102, 178, 0);
    transform: translate(-50%, -50%) scale(2.25);
  }
}

/* Bong bóng lời chào VNPT-Style khi rê chuột (Hình 2) */
.dtc-copilot-welcome-bubble {
  position: fixed;
  bottom: 22px;
  right: 88px;
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(0, 79, 149, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1.5px solid rgba(0, 102, 178, 0.38);
  z-index: 1054;
  max-width: 320px;
  min-width: 240px;
  cursor: pointer;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.dtc-copilot-welcome-bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -9px;
  transform: translateY(-50%);
  border-width: 8px 0 8px 9px;
  border-style: solid;
  border-color: transparent transparent transparent #ffffff;
  filter: drop-shadow(1.5px 0 1px rgba(0, 102, 178, 0.28));
}

.dtc-copilot-welcome-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 79, 149, 0.28);
  border-color: #0066b2;
}

.dtc-copilot-welcome-bubble.hide {
  opacity: 0;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(12px) scale(0.92);
}

.dtc-copilot-welcome-bubble.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.dtc-copilot-welcome-bubble .bubble-greeting-line1 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #004f95;
  line-height: 1.4;
  margin-bottom: 4px;
}

.dtc-copilot-welcome-bubble .bubble-greeting-line2 {
  font-size: 0.79rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.4;
}

/* 2. CHAT PANEL MAIN CONTAINER & CÔ TRỢ LÝ ĐỨNG BÊN CẠNH (HÌNH 1) */
#dtc-copilot-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 375px;
  /* Thu gọn cửa sổ chat từ 440px xuống 375px */
  max-width: calc(100vw - 32px);
  height: 520px;
  /* Thu gọn chiều cao từ 620px xuống 520px */
  max-height: calc(100vh - 120px);
  border-radius: 18px;
  background: transparent;
  display: flex;
  overflow: visible;
  /* Cho phép cô trợ lý toàn thân đứng ra phía ngoài bên cạnh */
  z-index: 1056;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

#dtc-copilot-panel:not(.is-open),
#dtc-copilot-panel:not(.is-open) *,
#dtc-copilot-panel:not(.is-open) .dtc-copilot-standing-assistant,
#dtc-copilot-panel:not(.is-open) .dtc-standing-img,
#dtc-copilot-panel:not(.is-open) .dtc-standing-bubble {
  pointer-events: none !important;
  visibility: hidden !important;
}

#dtc-copilot-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Cửa sổ chat chính */
.dtc-copilot-window {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25), 0 4px 16px rgba(0, 79, 149, 0.15);
  border: 1px solid rgba(0, 79, 149, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* CÔ TRỢ LÝ TOÀN THÂN ĐỨNG BÊN CẠNH CỬA SỔ CHAT (HÌNH 1) - TƯ THẾ LỄ TÂN CHUYÊN NGHIỆP */
.dtc-copilot-standing-assistant {
  position: absolute;
  right: calc(100% + 12px);
  bottom: 0;
  height: 62%;
  min-height: 310px;
  max-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 10;
  user-select: none;
  cursor: pointer;
}

#dtc-copilot-panel.is-open .dtc-copilot-standing-assistant {
  pointer-events: auto;
}

/* Khung chứa dáng đứng của cô trợ lý (Receptionist Figure Wrapper) */
.dtc-standing-figure-wrapper {
  position: relative;
  height: calc(100% - 24px);
  display: flex;
  align-items: flex-end;
  transform-origin: 50% 92%;
  animation: dtc-receptionist-full-lifelike 8s ease-in-out infinite;
}

/* Tư thế lễ tân thanh lịch: vai, ngực, 2 tay và đầu chuyển động nhẹ nhàng như người thật */
@keyframes dtc-receptionist-full-lifelike {
  0%, 100% {
    /* Hình 1: Nhìn thẳng, vai và lồng ngực giữ dáng lễ tân trang nghiêm */
    transform: translateY(0) scale(1) rotate(0deg);
  }
  14% {
    /* Nhịp hít vào: Ngực nở, vai nâng nhẹ 2.5px, 2 bàn tay đan trước bụng khẽ nhấp nhô theo hơi thở */
    transform: translateY(-2.5px) scale(1.008, 1.014) rotate(0.3deg);
  }
  24% {
    /* Điểm chớp mắt (Hình 3): Đầu khẽ gật nhẹ 0.6px như lịch sự cúi chào */
    transform: translateY(-1.2px) scale(1.004, 1.008) rotate(0deg);
  }
  28%, 52% {
    /* Hình 2: Khi liếc sang phải, đầu khẽ nghiêng nhẹ 0.8° sang phải theo hướng mắt, vai hạ nhẹ khi thở ra */
    transform: translateY(0.4px) scale(0.996, 0.998) rotate(0.8deg);
  }
  56% {
    /* Điểm chớp mắt chuyển hướng (Hình 3) */
    transform: translateY(-0.8px) scale(1.002, 1.006) rotate(0deg);
  }
  58%, 82% {
    /* Hình 4: Khi liếc sang trái, đầu khẽ nghiêng nhẹ -0.7° sang trái, cơ thể chuyển nhẹ trọng tâm chân duyên dáng */
    transform: translateY(-1.4px) scale(1.006, 1.01) rotate(-0.7deg);
  }
  85% {
    /* Điểm chớp mắt trở về (Hình 3) */
    transform: translateY(-0.5px) scale(1.002, 1.004) rotate(0deg);
  }
}

.dtc-standing-img {
  height: 100%;
  max-height: none;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(-4px 8px 18px rgba(0, 0, 0, 0.22));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
  cursor: pointer;
  transform-origin: 50% 40%; /* Tâm nở tự nhiên ngay ngực và 2 tay đan */
  animation: dtc-assistant-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1), dtc-standing-torso-breathe 4s ease-in-out infinite alternate;
}

/* Nhịp thở vi mô sinh động: Ngực nở, vai và 2 bàn tay đan chuyển động nhẹ nhàng như người thật 100% */
@keyframes dtc-standing-torso-breathe {
  0% {
    transform: scale(1, 1);
  }
  100% {
    transform: scale(1.007, 1.013) translateY(-1.0px);
  }
}

.dtc-copilot-standing-assistant:hover .dtc-standing-img:not(.is-clicked) {
  transform: scale(1.025) translateY(-2px);
  filter: drop-shadow(-6px 12px 22px rgba(0, 79, 149, 0.38));
}

/* Lớp phủ đôi mắt sống động cho cô trợ lý đứng (Chuẩn 4 trạng thái như ảnh thực tế) */
.dtc-standing-eyes-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Hốc mắt hình quả hạnh nhân (Almond Socket) */
.dtc-standing-eye-socket {
  position: absolute;
  overflow: hidden;
  border-radius: 50% 50% 45% 45%;
  background: transparent;
}

.dtc-standing-eye-left {
  left: 37.8%;
  top: 6.2%;
  width: 6.8%;
  height: 1.05%;
}

.dtc-standing-eye-right {
  left: 50.8%;
  top: 6.0%;
  width: 6.5%;
  height: 1.05%;
}

/* Nhãn cầu mắt (Sclera) - Viền mềm mại ôm trọn đôi mắt tự nhiên */
.dtc-standing-eyeball {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(ellipse at 50% 50%, #ffffff 35%, #faebe1 80%, rgba(240, 220, 210, 0.5) 100%);
  box-shadow: inset 0 0.5px 1px rgba(70, 40, 30, 0.2);
}

/* Con ngươi & tròng mắt (Iris & Pupil) */
.dtc-standing-iris {
  position: absolute;
  width: 56%;
  height: 96%;
  top: 2%;
  left: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffffff 12%, #603813 35%, #291206 70%, #0d0603 95%);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.7);
  animation: dtc-standing-iris-sequence 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.dtc-standing-glint-main {
  position: absolute;
  top: 18%;
  left: 22%;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: #ffffff;
}

.dtc-standing-glint-sub {
  position: absolute;
  bottom: 20%;
  right: 24%;
  width: 15%;
  height: 15%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
}

/* Ánh mắt liếc qua liếc lại nhìn người dùng và nhìn vào khung chat (8s chu kỳ chuẩn) */
@keyframes dtc-standing-iris-sequence {
  0%, 26% {
    /* Hình 1: Mở to nhìn thẳng tươi vui đón tiếp */
    transform: translate(0, 0);
  }
  28%, 52% {
    /* Hình 2: Liếc sang bên phải quan sát khung chat tin nhắn */
    transform: translate(1.4px, 0.1px);
  }
  54%, 56% {
    transform: translate(0, 0);
  }
  58%, 82% {
    /* Hình 4: Liếc sang bên trái quan sát tổng thể giao diện */
    transform: translate(-1.4px, 0.1px);
  }
  84%, 100% {
    /* Trở về nhìn thẳng mỉm cười đón ý */
    transform: translate(0, 0);
  }
}


/* Mí mắt khép xuống khi nhắm mắt / chớp mắt (Hình 3 chuẩn thanh tú) */
.dtc-standing-eyelid {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #fbede2 0%, #f5dfd2 60%, #eed3c0 100%);
  transform: translateY(-102%);
  pointer-events: none;
  animation: dtc-standing-eyelid-sequence 8s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

/* Hàng mi cong mềm mại khép lại khi nhắm mắt */
.dtc-standing-lash {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-bottom: 1.6px solid #2b170e;
  border-radius: 0 0 50% 50%;
}

/* Trình tự nhắm / chớp mắt tự nhiên cho cô trợ lý đứng (Hình 3 chuẩn) */
@keyframes dtc-standing-eyelid-sequence {
  0%, 25.5% {
    transform: translateY(-102%); /* Mắt mở hoàn toàn */
  }
  26%, 27.5% {
    transform: translateY(0%);    /* Hình 3: Nhắm mắt chớp nhẹ tự nhiên 0.15s */
  }
  28%, 55.5% {
    transform: translateY(-102%); /* Mắt mở hoàn toàn */
  }
  56%, 57.5% {
    transform: translateY(0%);    /* Hình 3: Nhắm mắt chớp chuyển hướng nhìn */
  }
  58%, 84.5% {
    transform: translateY(-102%); /* Mắt mở hoàn toàn */
  }
  85%, 86.5% {
    transform: translateY(0%);    /* Hình 3: Nhắm mắt chớp nhẹ nhã nhặn */
  }
  87%, 100% {
    transform: translateY(-102%); /* Mắt mở nhìn thẳng */
  }
}

/* Thẻ trạng thái lễ tân trực sảnh chờ lệnh */
.dtc-standing-reception-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 78, 162, 0.25);
  box-shadow: 0 4px 12px rgba(0, 78, 162, 0.15);
  border-radius: 20px;
  padding: 2.5px 8px;
  margin-top: 4px;
  pointer-events: none;
  white-space: nowrap;
}

.dtc-reception-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: dtc-dot-pulse 2s infinite;
}

@keyframes dtc-dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

.dtc-reception-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: #004ea2;
  letter-spacing: 0.2px;
}

/* Chuyển động sinh động khi click vào hình dáng cô trợ lý (Click Motion) */
.dtc-standing-img.is-clicked {
  animation: dtc-assistant-click-motion 0.75s cubic-bezier(0.25, 1.25, 0.5, 1) !important;
}

@keyframes dtc-assistant-click-motion {
  0% {
    transform: scale(1) translateY(0) rotate(0deg);
  }

  18% {
    transform: scale(1.08) translateY(-14px) rotate(-4deg);
    /* Cúi chào tươi vui thanh lịch */
  }

  38% {
    transform: scale(0.96, 1.04) translateY(2px) rotate(2deg);
    /* Nhún người tươi cười */
  }

  58% {
    transform: scale(1.03, 0.98) translateY(-6px) rotate(-1deg);
    /* Lắc nhẹ chào hỏi */
  }

  78% {
    transform: scale(1, 1) translateY(-1px) rotate(0.5deg);
  }

  100% {
    transform: scale(1) translateY(0) rotate(0deg);
  }
}

@keyframes dtc-assistant-slide-in {
  0% {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Bong bóng thoại trên đầu cô trợ lý khi rê chuột vào hoặc khi click */
.dtc-standing-bubble {
  position: absolute;
  bottom: calc(100% + 4px);
  /* Nằm ngay trên đầu cô trợ lý */
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.92);
  transform-origin: bottom center;
  background: #ffffff;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 10px 28px rgba(0, 79, 149, 0.22);
  border: 1.5px solid rgba(0, 102, 178, 0.35);
  max-width: 220px;
  min-width: 175px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1058;
}

.dtc-standing-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 7px 0 7px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
  filter: drop-shadow(0 1.5px 1px rgba(0, 102, 178, 0.2));
}

.dtc-copilot-standing-assistant:hover .dtc-standing-bubble,
.dtc-standing-bubble.is-active {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}

.dtc-standing-bubble .bubble-greeting-line1 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #004f95;
  line-height: 1.35;
  margin-bottom: 3px;
}

.dtc-standing-bubble .bubble-greeting-line2 {
  font-size: 0.76rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.35;
}

/* 3. PANEL HEADER */
.dtc-copilot-header {
  background: linear-gradient(135deg, #00428d 0%, #005baa 100%);
  color: #ffffff;
  padding: 6px 14px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.dtc-copilot-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dtc-copilot-header-logo {
  height: 24px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  display: block;
}

.dtc-copilot-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
  color: #ffffff;
  line-height: 1;
  display: flex;
  align-items: center;
}

.dtc-copilot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dtc-copilot-btn-icon {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.dtc-copilot-btn-icon:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}

.dtc-copilot-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dtc-copilot-btn-icon {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dtc-copilot-btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* 4. QUICK SUGGESTION CHIPS */
.dtc-copilot-quick-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none;
}

.dtc-copilot-quick-chips::-webkit-scrollbar {
  display: none;
}

.dtc-copilot-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.dtc-copilot-chip:hover {
  background: #004f95;
  color: #ffffff;
  border-color: #004f95;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 79, 149, 0.25);
}

/* 5. MESSAGES STREAM CONTAINER */
.dtc-copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  scroll-behavior: smooth;
}

.dtc-copilot-messages::-webkit-scrollbar {
  width: 5px;
}

.dtc-copilot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Tin nhắn của Người dùng */
.dtc-copilot-msg-user {
  align-self: flex-end;
  max-width: 82%;
  background: linear-gradient(135deg, #004f95 0%, #0066b2 100%);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  font-size: 0.85rem;
  line-height: 1.45;
  box-shadow: 0 3px 10px rgba(0, 79, 149, 0.22);
  word-break: break-word;
}

/* Tin nhắn của Trợ lý AI */
.dtc-copilot-msg-ai {
  align-self: flex-start;
  max-width: 94%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dtc-copilot-msg-ai .msg-header-row {
  display: flex;
  align-items: center;
  /* Cân chỉnh ngay trung tâm vòng tròn hình cô trợ lý */
  gap: 9px;
  user-select: none;
}

.dtc-copilot-msg-ai .msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 79, 149, 0.2);
  border: 1.5px solid #ffffff;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dtc-copilot-msg-ai .msg-sender-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #004f95;
  line-height: 1;
  /* Chuẩn tâm trục ngang với avatar */
  letter-spacing: 0.2px;
}

.dtc-copilot-msg-ai .msg-bubble {
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  padding: 12px 15px;
  border-radius: 4px 16px 16px 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  word-break: break-word;
}

.dtc-copilot-msg-ai .msg-bubble-card,
.dtc-copilot-msg-ai .msg-bubble:has(.dtc-welcome-card) {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  max-width: 100%;
}

/* THẺ CHÀO MỪNG VNPT STYLE (WELCOME CARD) */
.dtc-welcome-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 79, 149, 0.16);
  box-shadow: 0 4px 20px rgba(0, 79, 149, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  width: 100%;
}

.dtc-welcome-text {
  padding: 16px 18px 15px;
  font-size: 0.89rem;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.6;
  min-height: 75px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.dtc-welcome-actions {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.dtc-welcome-action-btn {
  width: 100%;
  height: 35px;
  min-height: 35px;
  max-height: 35px;
  box-sizing: border-box;
  padding: 0 16px;
  background: #ffffff;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  color: #0066b2;
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  font-family: inherit;
  user-select: none;
  position: relative;
}

.dtc-welcome-action-btn:last-child {
  border-bottom: none;
}

/* Hiệu ứng di chuột dòng menu chuẩn web công nghệ hàng đầu */
.dtc-welcome-action-btn:hover {
  background: linear-gradient(90deg, rgba(0, 102, 178, 0.03) 0%, rgba(0, 102, 178, 0.1) 50%, rgba(0, 102, 178, 0.03) 100%);
  color: #004f95;
  font-weight: 700;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(0, 102, 178, 0.15), 0 2px 8px rgba(0, 79, 149, 0.08);
  z-index: 2;
}

.dtc-welcome-action-btn:active {
  transform: translateY(0) scale(0.99);
  background: rgba(0, 102, 178, 0.14);
}

.dtc-copilot-msg-ai .msg-bubble p {
  margin-bottom: 8px;
}

.dtc-copilot-msg-ai .msg-bubble p:last-child {
  margin-bottom: 0;
}

.dtc-copilot-msg-ai .msg-bubble ul,
.dtc-copilot-msg-ai .msg-bubble ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.dtc-copilot-msg-ai .msg-bubble strong {
  color: #00428d;
}

/* Bảng biểu trong tin nhắn AI */
.dtc-copilot-table-wrapper {
  overflow-x: auto;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.dtc-copilot-msg-ai table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.dtc-copilot-msg-ai th {
  background: #f1f5f9;
  color: #00428d;
  font-weight: 700;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.dtc-copilot-msg-ai td {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
}

.dtc-copilot-msg-ai tr:nth-child(even) {
  background: #ffffff;
}

.dtc-copilot-msg-ai tr:nth-child(odd) {
  background: #f8fafc;
}

/* 6. ACTION BUTTONS TRONG TIN NHẮN (COPILOT HANDS) */
.dtc-copilot-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.dtc-copilot-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #004f95;
  background: #eff6ff;
  color: #004f95;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.dtc-copilot-action-btn:hover {
  background: #004f95;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 79, 149, 0.28);
}

.dtc-copilot-action-btn.btn-action-map {
  border-color: #0284c7;
  background: #f0f9ff;
  color: #0284c7;
}

.dtc-copilot-action-btn.btn-action-map:hover {
  background: #0284c7;
  color: #ffffff;
}

.dtc-copilot-action-btn.btn-action-maintenance {
  border-color: #d97706;
  background: #fffbeb;
  color: #d97706;
}

.dtc-copilot-action-btn.btn-action-maintenance:hover {
  background: #d97706;
  color: #ffffff;
}

/* Nút liên kết Google Earth chỉ đường màu xanh ngọc/lá cây chuẩn hình gửi kèm (#268c66) */
.dtc-copilot-action-btn.btn-action-earth-route {
  border-color: #268c66;
  background: linear-gradient(135deg, #1f7a55 0%, #268c66 50%, #21835c 100%);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(38, 140, 102, 0.35);
  animation: dtc-green-btn-blink 1.5s infinite ease-in-out;
  padding: 7px 16px;
  border-radius: 10px;
}

.dtc-copilot-action-btn.btn-action-earth-route i {
  color: #ffffff;
  font-size: 0.92rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.dtc-copilot-action-btn.btn-action-earth-route span {
  color: #ffffff;
}

.dtc-copilot-action-btn.btn-action-earth-route:hover {
  background: linear-gradient(135deg, #1a6d4c 0%, #21835c 100%);
  color: #ffffff !important;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 14px rgba(38, 140, 102, 0.55);
  animation: none;
}

.dtc-copilot-action-btn.btn-action-earth-route:active {
  transform: translateY(0) scale(0.98);
}

@keyframes dtc-green-btn-blink {
  0% {
    box-shadow: 0 0 0 0 rgba(38, 140, 102, 0.75), 0 2px 8px rgba(38, 140, 102, 0.35);
    background: linear-gradient(135deg, #1f7a55 0%, #268c66 50%, #21835c 100%);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(38, 140, 102, 0), 0 4px 14px rgba(38, 140, 102, 0.65);
    background: linear-gradient(135deg, #28966e 0%, #34a87a 50%, #268c66 100%);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(38, 140, 102, 0), 0 2px 8px rgba(38, 140, 102, 0.35);
    background: linear-gradient(135deg, #1f7a55 0%, #268c66 50%, #21835c 100%);
  }
}

/* Hiệu ứng gõ chữ hoặc suy nghĩ (Typing indicator) */
.dtc-copilot-typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: #004f95;
  font-size: 0.8rem;
  font-weight: 600;
}

.dtc-copilot-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dtc-copilot-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #004f95;
  animation: dtc-copilot-bounce 1.2s infinite ease-in-out both;
}

.dtc-copilot-typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.dtc-copilot-typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.dtc-copilot-typing-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dtc-copilot-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.4);
    opacity: 0.35;
  }

  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* 7. INPUT BAR CONTAINER */
.dtc-copilot-footer {
  padding: 10px 14px 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.dtc-copilot-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 5px 8px 5px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dtc-copilot-input-row:focus-within {
  border-color: #004f95;
  box-shadow: 0 0 0 3px rgba(0, 79, 149, 0.15);
  background: #ffffff;
}

#dtc-copilot-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.86rem;
  font-family: inherit;
  color: #0f172a;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  padding: 6px 0;
}

#dtc-copilot-input::placeholder {
  color: #94a3b8;
  font-size: 0.82rem;
}

.dtc-copilot-btn-voice {
  background: transparent;
  border: none;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dtc-copilot-btn-voice:hover {
  color: #004f95;
  background: rgba(0, 79, 149, 0.1);
}

.dtc-copilot-btn-voice.is-listening {
  color: #ef4444;
  background: #fee2e2;
  animation: dtc-mic-pulse 1.2s infinite;
}

@keyframes dtc-mic-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.dtc-copilot-btn-send {
  background: linear-gradient(135deg, #004f95 0%, #0066b2 100%);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dtc-copilot-btn-send:hover {
  background: #003e75;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 79, 149, 0.3);
}

.dtc-copilot-btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dtc-copilot-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #64748b;
  padding: 0 4px;
}

.dtc-copilot-footnote a {
  color: #004f95;
  text-decoration: none;
}

.dtc-copilot-footnote a:hover {
  text-decoration: underline;
}

/* 8. MOBILE RESPONSIVE TUNING */
@keyframes dtc-blue-ripple-mobile {
  0% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0.65;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.45);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.45);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  #dtc-copilot-fab {
    bottom: 72px;
    /* Cách thanh mobile-bottom-nav & nằm gọn trong viewport */
    right: 18px;
    width: 42px;
    height: 42px;
  }

  #dtc-copilot-fab .dtc-ripple-ring {
    animation-name: dtc-blue-ripple-mobile !important;
  }

  .dtc-copilot-welcome-bubble {
    display: none !important;
  }

  #dtc-copilot-panel {
    bottom: 70px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: calc(100vw - 16px);
    height: calc(100vh - 140px);
    border-radius: 16px;
  }
}

@media (max-width: 991px) {
  .dtc-copilot-standing-assistant {
    display: none !important;
  }
}