/* HEL Chatbot - Styles */
:root {
  --hel-bd: #2a2a9d;
  --hel-bl: #5656ba;
  --hel-gd: #00b580;
  --hel-gl: #1bc997;
  --hel-ye: #ffa000;
  --hel-bg: #f7f8ff;
  --hel-white: #ffffff;
  --hel-text: #1a1a4e;
  --hel-gray: #6b7280;
  --hel-radius: 18px;
  --hel-shadow: 0 20px 60px rgba(42,42,157,.2);
}

/* TRIGGER BUTTON */
#hel-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, var(--hel-bd), var(--hel-bl));
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(42,42,157,.45);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 99998;
  border: none;
}
#hel-trigger:hover { transform: scale(1.1); }

.hel-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 20px; height: 20px;
  background: var(--hel-ye);
  border-radius: 50%;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--hel-text);
  animation: hel-bounce 2s infinite;
}
@keyframes hel-bounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

/* CHAT WINDOW */
#hel-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 390px;
  height: 560px;
  background: var(--hel-white);
  border-radius: var(--hel-radius);
  box-shadow: var(--hel-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  opacity: 0;
  transform: translateY(20px) scale(.95);
  pointer-events: none;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#hel-window.hel-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* HEADER */
.hel-header {
  background: var(--hel-bd);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}
.hel-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hel-gd), var(--hel-gl), var(--hel-ye));
}
.hel-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hel-hinfo h3 {
  color: white;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.hel-hinfo p {
  color: rgba(255,255,255,.7);
  font-size: 11px;
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.hel-dot {
  width: 7px; height: 7px;
  background: var(--hel-gl);
  border-radius: 50%;
  animation: hel-pulse 2s infinite;
}
@keyframes hel-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.hel-close {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  transition: background .15s;
}
.hel-close:hover { background: rgba(255,255,255,.25); }

/* MESSAGES */
#hel-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--hel-bg);
  scroll-behavior: smooth;
}
#hel-msgs::-webkit-scrollbar { width: 3px; }
#hel-msgs::-webkit-scrollbar-thumb { background: var(--hel-bl); border-radius: 2px; }

.hel-msg {
  display: flex;
  gap: 8px;
  animation: hel-in .25s ease;
}
@keyframes hel-in { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }
.hel-msg.hel-u { flex-direction: row-reverse; margin-left: auto; max-width: 80%; }
.hel-msg.hel-b { max-width: 85%; }

.hel-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
}
.hel-av.bot { background: var(--hel-bd); color: white; }
.hel-av.usr { background: #e0e0f8; color: var(--hel-bd); }

.hel-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
}
.hel-msg.hel-b .hel-bubble {
  background: white;
  color: var(--hel-text);
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 2px 8px rgba(42,42,157,.07);
  border: 1px solid rgba(42,42,157,.06);
}
.hel-msg.hel-u .hel-bubble {
  background: var(--hel-bd);
  color: white;
  border-radius: 14px 4px 14px 14px;
}
.hel-bubble a { color: var(--hel-bd); font-weight: 500; }
.hel-msg.hel-u .hel-bubble a { color: rgba(255,255,255,.85); }

.hel-ts {
  font-size: 10px;
  color: var(--hel-gray);
  margin-top: 3px;
  padding: 0 3px;
}
.hel-msg.hel-u .hel-ts { text-align: right; }

/* QUICK REPLIES */
.hel-qrs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.hel-qr {
  background: var(--hel-bd);
  border: none;
  color: white;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background .15s;
}
.hel-qr:hover { background: var(--hel-bl); }

/* TYPING */
.hel-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: white;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 2px 8px rgba(42,42,157,.07);
  width: fit-content;
}
.hel-td {
  width: 7px; height: 7px;
  background: var(--hel-bl);
  border-radius: 50%;
  animation: hel-ty 1.4s infinite;
}
.hel-td:nth-child(2) { animation-delay: .2s; }
.hel-td:nth-child(3) { animation-delay: .4s; }
@keyframes hel-ty { 0%,60%,100%{transform:translateY(0);opacity:.3} 30%{transform:translateY(-6px);opacity:1} }

/* INPUT */
.hel-foot {
  padding: 11px 13px;
  background: white;
  border-top: 1px solid rgba(42,42,157,.08);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
#hel-inp {
  flex: 1;
  border: 1.5px solid rgba(42,42,157,.15);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--hel-text);
  resize: none;
  outline: none;
  max-height: 90px;
  transition: border-color .2s;
  background: var(--hel-bg);
  line-height: 1.5;
  font-family: inherit;
}
#hel-inp:focus { border-color: var(--hel-bl); background: white; }
#hel-inp::placeholder { color: #9ca3af; }
#hel-send {
  width: 38px; height: 38px;
  background: var(--hel-bd);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(42,42,157,.3);
  transition: all .2s;
}
#hel-send:hover { background: var(--hel-bl); transform: scale(1.05); }
#hel-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.hel-ftr {
  text-align: center;
  padding: 5px;
  font-size: 10px;
  color: var(--hel-gray);
  background: white;
  border-top: 1px solid rgba(0,0,0,.04);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  #hel-window {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 88px;
    height: 70vh;
  }
}
