/* Original Cocoon Child mascot styling, migrated with no artwork or drag redesign. */
/* ========================================
   HOCDII - FLOATING CONTACT FINAL
======================================== */

.hocdii-contact-widget {
  position: fixed;
  right: 18px;
  bottom: 250px;
  z-index: 99999;
  width: 68px !important;
  height: 68px !important;
  display: block !important;
}

.hocdii-contact-widget.hcm-sky-hidden-while-open,
.hocdii-contact-widget.hcm-sky-drawer-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity .15s ease !important;
}

/* Pure CSS zero-flicker guard: hide mascot while Cocoon left menu or search drawer is open */
body:has(#navi-menu-input:checked) #hocdiiContactWidget,
body:has(#search-menu-input:checked) #hocdiiContactWidget {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Mobile docked mascot perched cleanly on the top-right corner of the open chat card */
.hocdii-contact-widget.hcm-sky-mobile-docked {
  z-index: 100002 !important;
  transition: top .18s ease, left .18s ease;
}

/* =========================
   Nút floating chính
========================= */
.hocdii-contact-toggle {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 68px;
  height: 68px;
  border: 2px solid #173142;
  border-radius: 50%;
  overflow: hidden;
  background: #7ed957;
  box-shadow: 0 12px 26px rgba(21, 78, 68, 0.28);
  padding: 0;
  margin: 0;
  cursor: grab;
  appearance: none;
  outline: none;
  touch-action: none !important;
  user-select: none;
  -webkit-user-select: none;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

.hocdii-contact-toggle-icon {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7ed957;
}

.hocdii-contact-toggle-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
  transform: scaleX(-1);
}

.hocdii-contact-widget.hcm-mascot-face-right .hocdii-contact-toggle-icon img {
  transform: scaleX(1);
}

/* Hover desktop */
@media screen and (hover: hover) {
  .hocdii-contact-toggle:hover {
    transform: scale(1.12);
    box-shadow: 0 18px 34px rgba(17, 116, 84, .34);
    filter: brightness(1.05) saturate(1.08);
  }
}

/* Khi đang kéo */
.hocdii-contact-widget.is-dragging .hocdii-contact-toggle {
  transform: scale(1.08);
  cursor: grabbing;
  box-shadow: 0 18px 38px rgba(17, 116, 84, .38);
  transition: none;
}

/* MOBILE */
@media screen and (max-width: 768px) {
  .hocdii-contact-widget {
    right: 12px;
    bottom: 220px;
    width: 42px !important;
    height: 42px !important;
  }

  .hocdii-contact-toggle {
    width: 42px;
    height: 42px;
  }

  .hocdii-contact-toggle-icon {
    inset: 0;
  }
}

/* Pre-migration guard: suppress legacy floating contact menu if Cocoon Child is not yet migrated. */
#hocdiiContactLinks{display:none!important;visibility:hidden!important;pointer-events:none!important}
#hocdiiContactWidget .hocdii-contact-toggle{touch-action:none}

/* PA1 — Hocdii Sky Chat Dialog (Refined UI + Vietnamese-safe typography) */
#hcm-sky-chat[hidden]{display:none!important}
#hcm-sky-chat,#hcm-sky-chat *{box-sizing:border-box}
#hcm-sky-chat{
  position:fixed;
  z-index:100001;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #d6e4f7;
  border-radius:20px;
  background:#fff;
  box-shadow:0 20px 56px rgba(16,46,89,.20),0 4px 14px rgba(22,119,255,.10);
  font-family:"Be Vietnam Pro","Segoe UI",Roboto,-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-feature-settings:"kern" 1;
  color:#172033;
  font-size:14px;
  line-height:1.55;
  overscroll-behavior:contain;
  animation:hcm-sky-in .17s ease-out both;
}
@keyframes hcm-sky-in{from{opacity:.75;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}

/* Header */
#hcm-sky-chat .hcm-sky-head{
  display:flex;
  align-items:center;
  gap:12px;
  background:linear-gradient(135deg,#1677ff 0%,#0f64e8 100%);
  padding:13px 12px 13px 16px;
  flex:none;
  min-height:66px;
  color:#fff;
}
#hcm-sky-chat .hcm-sky-head-icon{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:0 0 38px;
  border-radius:50%;
  background:rgba(255,255,255,.20);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28);
  font-size:19px;
}
#hcm-sky-chat .hcm-sky-head-text{
  display:flex;
  flex:1;
  min-width:0;
  flex-direction:column;
  gap:1px;
  line-height:1.3;
}
#hcm-sky-chat .hcm-sky-head-text strong{
  font-size:15.5px;
  font-weight:700;
  letter-spacing:-.01em;
  color:#fff;
}
#hcm-sky-chat .hcm-sky-head-text small{
  font-size:12px;
  font-weight:400;
  color:rgba(255,255,255,.88);
}
#hcm-sky-chat button{font:inherit;cursor:pointer}
#hcm-sky-chat .hcm-sky-icon-btn{
  border:0;
  background:rgba(255,255,255,.12);
  color:#fff;
  width:34px;
  height:34px;
  padding:0;
  display:grid;
  place-items:center;
  font-size:21px;
  line-height:1;
  border-radius:10px;
  flex:none;
  transition:background .15s ease;
}
#hcm-sky-chat .hcm-sky-icon-btn:hover{background:rgba(255,255,255,.24)}

/* Message stream */
#hcm-sky-chat .hcm-sky-messages{
  background:linear-gradient(180deg,#f4f8ff 0%,#f8fbff 100%);
  flex:1;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:16px 14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  scrollbar-width:thin;
  scrollbar-color:#cbd9ec transparent;
  overscroll-behavior:contain;
}
#hcm-sky-chat .hcm-sky-day{
  align-self:center;
  font-size:11.5px;
  font-weight:600;
  background:#e6f0fe;
  color:#556987;
  border-radius:999px;
  padding:3px 14px;
  margin-bottom:2px;
}
#hcm-sky-chat .hcm-sky-bubble-row{
  display:flex;
  align-items:flex-end;
  gap:8px;
  width:100%;
}
#hcm-sky-chat .hcm-sky-bubble-row.is-customer{justify-content:flex-end}
#hcm-sky-chat .hcm-sky-avatar{
  display:grid;
  place-items:center;
  flex:0 0 28px;
  width:28px;
  height:28px;
  background:#e2eeff;
  color:#1677ff;
  border-radius:50%;
  font-size:14px;
  box-shadow:0 1px 3px rgba(22,119,255,.12);
}
#hcm-sky-chat .hcm-sky-bubble{
  max-width:82%;
  border-radius:16px;
  padding:10px 13px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  min-width:48px;
  font-size:13.5px;
  line-height:1.55;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
}
#hcm-sky-chat .hcm-sky-bubble.is-agent{
  background:#fff;
  border:1px solid #e2ecf8;
  color:#172033;
  border-bottom-left-radius:5px;
  box-shadow:0 2px 8px rgba(16,42,86,.05);
}
#hcm-sky-chat .hcm-sky-bubble.is-customer{
  background:linear-gradient(135deg,#1677ff 0%,#2382ff 100%);
  color:#fff;
  border-bottom-right-radius:5px;
  box-shadow:0 3px 10px rgba(22,119,255,.22);
}
#hcm-sky-chat .hcm-sky-bubble strong{
  font-weight:700;
  font-size:14px;
  color:inherit;
}
#hcm-sky-chat .hcm-sky-bubble small,#hcm-sky-chat .hcm-sky-meta{
  font-size:10.5px;
  align-self:flex-end;
  opacity:.78;
  margin-top:2px;
  display:inline-flex;
  align-items:center;
  gap:5px;
}
#hcm-sky-chat .hcm-sky-status{font-weight:600}
#hcm-sky-chat .hcm-sky-media{
  width:auto;
  max-width:100%;
  max-height:210px;
  object-fit:contain;
  border-radius:10px;
}

/* Status & Error banners */
#hcm-sky-chat .hcm-sky-notice{
  padding:7px 14px;
  color:#1d4ed8;
  background:#eff6ff;
  border-top:1px solid #dbeafe;
  font-size:12px;
  flex:none;
}
#hcm-sky-chat .hcm-sky-error{
  padding:7px 14px;
  color:#b42318;
  background:#fff1f0;
  border-top:1px solid #fecdd3;
  font-size:12px;
  flex:none;
}

/* Compose bar */
#hcm-sky-chat .hcm-sky-compose{
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding:10px 12px 12px;
  background:#fff;
  border-top:1px solid #e7eff9;
  flex:none;
}
#hcm-sky-chat .hcm-sky-attach{
  height:40px;
  width:38px;
  flex:0 0 38px;
  border:0;
  background:#f3f7fc;
  color:#4c617d;
  font-size:22px;
  line-height:1;
  padding:0;
  display:grid;
  place-items:center;
  border-radius:50%;
  transition:background .15s ease,color .15s ease;
}
#hcm-sky-chat .hcm-sky-attach:hover{background:#e6f0ff;color:#1677ff}

/* Clean 1-line pill input: zero Windows scrollbar arrows, strict override of theme textarea rules */
#hcm-sky-chat .hcm-sky-compose textarea{
  flex:1!important;
  min-width:0!important;
  width:auto!important;
  height:40px!important;
  min-height:40px!important;
  max-height:92px!important;
  resize:none!important;
  outline:none!important;
  appearance:none!important;
  -webkit-appearance:none!important;
  border:1px solid #d5e2f2!important;
  border-radius:20px!important;
  background:#f5f8fc!important;
  color:#172033!important;
  padding:8px 14px!important;
  font-family:"Be Vietnam Pro","Segoe UI",Roboto,-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif!important;
  font-size:14px!important;
  line-height:22px!important;
  box-shadow:none!important;
  margin:0!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
}
#hcm-sky-chat .hcm-sky-compose textarea.is-scrollable{
  overflow-y:auto!important;
  scrollbar-width:thin!important;
}
#hcm-sky-chat .hcm-sky-compose textarea::-webkit-scrollbar{width:0;height:0}
#hcm-sky-chat .hcm-sky-compose textarea.is-scrollable::-webkit-scrollbar{width:4px}
#hcm-sky-chat .hcm-sky-compose textarea::placeholder{color:#8494aa!important;opacity:1!important}
#hcm-sky-chat .hcm-sky-compose textarea:focus,#hcm-sky-chat .hcm-sky-compose textarea:focus-visible{
  border-color:#1677ff!important;
  background:#fff!important;
  outline:none!important;
  box-shadow:0 0 0 3px rgba(22,119,255,.12)!important;
}
#hcm-sky-chat .hcm-sky-send{
  width:40px;
  height:40px;
  flex:0 0 40px;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#1677ff 0%,#0f64e8 100%);
  color:#fff;
  font-weight:700;
  font-size:20px;
  line-height:1;
  padding:0;
  box-shadow:0 4px 12px rgba(22,119,255,.26);
  transition:transform .12s ease,opacity .15s ease;
}
#hcm-sky-chat .hcm-sky-send:active{transform:scale(.94)}
#hcm-sky-chat .hcm-sky-send:disabled,#hcm-sky-chat .hcm-sky-send.is-sending{opacity:.55;cursor:wait}
#hcm-sky-chat button:focus-visible{outline:2px solid #6bafff;outline-offset:2px}

/* Mobile & iOS Safari compact keyboard adaptation */
@media(max-width:1023px){
  #hcm-sky-chat .hcm-sky-compose textarea{
    font-size:16px!important;
    line-height:22px!important;
    padding:8px 14px!important;
  }
}
@media(max-width:768px){
  #hcm-sky-chat{border-radius:18px}
  #hcm-sky-chat .hcm-sky-head{padding:11px 10px 11px 14px;min-height:58px}
  #hcm-sky-chat .hcm-sky-messages{padding:12px 11px}
  #hcm-sky-chat.is-kb-open .hcm-sky-head{min-height:48px;padding:7px 10px 7px 12px}
  #hcm-sky-chat.is-kb-open .hcm-sky-head-icon{width:30px;height:30px;flex:0 0 30px;font-size:16px}
  #hcm-sky-chat.is-kb-open .hcm-sky-head-text small{display:none}
  #hcm-sky-chat.is-kb-open .hcm-sky-compose{padding:7px 10px 9px}
}
@media(prefers-reduced-motion:reduce){#hcm-sky-chat{animation:none}}

/* Mascot CSKH identification + unread badge & toast */
.hocdii-contact-widget .hocdii-contact-toggle { overflow: visible !important; }
.hcm-mascot-chat-ico {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(22, 119, 255, .38);
  pointer-events: none;
  z-index: 2;
}
.hcm-mascot-tag {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: #1677ff;
  color: #fff;
  border: 1.5px solid #fff;
  font-family: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 46, 89, .24);
  pointer-events: none;
  z-index: 2;
}
.hcm-mascot-badge {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-family: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(239, 68, 68, .42);
  pointer-events: none;
  z-index: 3;
}
.hcm-mascot-badge[hidden] { display: none !important; }
.hcm-mascot-toast {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 6px;
  max-width: 230px;
  padding: 8px 12px;
  border: 1px solid #dbe6f4;
  border-radius: 14px 14px 4px 14px;
  background: #fff;
  color: #0f2544;
  font-family: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 24px rgba(16, 46, 89, .18);
  cursor: pointer;
  z-index: 100000;
}
.hcm-mascot-toast[hidden] { display: none !important; }
@media (max-width: 768px) {
  .hcm-mascot-chat-ico { width: 18px; height: 18px; font-size: 9px; right: -2px; top: -2px; }
  .hcm-mascot-tag { font-size: 9px; padding: 1px 6px; bottom: -8px; }
  .hcm-mascot-badge { min-width: 19px; height: 19px; font-size: 10px; }
  .hcm-mascot-toast { max-width: 190px; font-size: 12px; padding: 7px 10px; }
}

.hcm-sky-pending{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px;background:#f0f6ff;border-top:1px solid #dbeafe;font-size:12px;color:#0f2544;flex:none}
.hcm-sky-pending[hidden]{display:none!important}
.hcm-sky-pending-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.hcm-sky-pending-rm{border:0;background:transparent;color:#64748b;font-size:18px;line-height:1;padding:0 4px;cursor:pointer}
.hcm-sky-file-card{display:inline-flex;align-items:center;gap:6px;padding:7px 11px;border-radius:10px;background:rgba(255,255,255,.18);color:inherit;text-decoration:none;font-weight:600;font-size:12.5px;border:1px solid currentColor}
.hcm-sky-bubble.is-agent .hcm-sky-file-card{background:#f1f5fb;border-color:#cbd5e1;color:#0f2544}
