#hiet-bot *,
#hiet-bot *::before,
#hiet-bot *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Cairo", "Tajawal", sans-serif;
}

#hiet-bot {
  position: fixed;
  bottom: 70px;
  left: 24px;
  z-index: 99999;
  direction: rtl;
}

#hiet-trigger {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a237e, #1565c0);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(26, 35, 126, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  position: relative;
}

#hiet-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(26, 35, 126, 0.6);
}

#hiet-trigger::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(26, 35, 126, 0.25);
  animation: hiet-pulse 2.8s ease-out infinite;
}

@keyframes hiet-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

#hiet-trigger svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  transition: all 0.25s;
}

#hiet-trigger .ic-open {
  display: block;
}
#hiet-trigger .ic-close {
  display: none;
}
#hiet-trigger.open .ic-open {
  display: none;
}
#hiet-trigger.open .ic-close {
  display: block;
}
#hiet-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: hiet-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hiet-pop {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}


#hiet-window {
  position: absolute;
  bottom: 74px;
  left: 0;
  width: 360px;
  max-height: 450px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(16px);
  transform-origin: bottom left;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s;
}

#hiet-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

#hiet-header {
  background: linear-gradient(135deg, #1a237e 0%, #283593 55%, #1565c0 100%);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  flex-shrink: 0;
}

.hiet-av {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.hiet-hname {
  font-weight: 700;  margin-right: 20px ;

  font-size: 14.5px;
}

.hiet-hstatus {  margin-right: 20px ;

  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

.hiet-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: hiet-blink 2s ease-in-out infinite;
}

@keyframes hiet-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}


#hiet-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  scrollbar-width: thin;
  scrollbar-color: #c7d2fe transparent;
}

#hiet-msgs::-webkit-scrollbar {
  width: 4px;
}
#hiet-msgs::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 4px;
}


.hiet-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.hiet-row.bot {
  justify-content: flex-end;
}
.hiet-row.user {
  justify-content: flex-start;
}

.hiet-bubble {
  max-width: 82%;
  
  padding: 20px 30px;
  font-size: 13.5px;
  line-height: 1.65;
  animation: hiet-in 0.3s ease;
  word-break: break-word;
}

@keyframes hiet-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hiet-bubble.bot {
  background: #fff;
  color: #1e293b;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  padding:10px 20px !important;
}

.hiet-bubble.user {
  background: linear-gradient(135deg, #1a237e, #1565c0);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  padding: 10px !important;
}

.hiet-mini-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a237e, #283593);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  color: #fff;
}

.hiet-ts {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  margin: 0 4px 2px;
  
}

.hiet-typing {

  display: flex;
  gap: 5px;
  align-items: center;
  padding: 11px 14px;
  background: #fff;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  max-width: 70px;
}

.hiet-typing span {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: hiet-td 1.3s ease-in-out infinite;
}

.hiet-typing span:nth-child(2) {
  animation-delay: 0.18s;
}
.hiet-typing span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes hiet-td {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.hiet-chip {
    
  text-align: center;
  padding: 4px 0;
}

.hiet-chip span {
  display: inline-block;
  background: #ede9fe;
  color: #4c1d95;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 12px !important;
  border-radius: 20px;
}

#hiet-quick {
  padding: 8px 12px 6px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 5px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.hiet-qbtn {
  background: #fff;
  border: 1.5px solid #c7d2fe;
  color: #1a237e;
  border-radius: 20px;
  padding: 5px 10px !important;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.hiet-qbtn:hover {
  background: #1a237e;
  color: #fff;
  border-color: #1a237e;
  transform: translateY(-1px);
}

#hiet-input-area {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

#hiet-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 22px;
  padding: 9px 15px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  color: #1e293b;
  transition: border-color 0.2s;
  background: #f8fafc;
  direction: rtl;
  resize: none;
  max-height: 90px;
  overflow-y: auto;
}

#hiet-input:focus {
  border-color: #1a237e;
  background: #fff;
}

#hiet-input::placeholder {
  color: #94a3b8;
}

#hiet-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a237e, #1565c0);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(26, 35, 126, 0.35);
  transition: transform 0.2s;
  flex-shrink: 0;
}

#hiet-send:hover {
  transform: scale(1.08);
}

#hiet-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}
.hiet-bubble .user{
border: solid !important;
}

@media (max-width: 420px) {
  #hiet-window {
    width: calc(100vw - 50px);
  }
  #hiet-bot {
    left: 16px;
    bottom: 50px;
  }
  #hiet-quick {
    grid-template-columns:repeat(3,1fr)
  }

}
