/* ============================================================
   CHAT ASISTEN AI — KURSUS 3 IN 1 (tema LIGHT)
   Bubble chat jawaban otomatis + launcher + teaser
   ============================================================ */

/* ---------- Launcher (tombol chat di kanan bawah) ---------- */
.chat-launcher{
  position:fixed;right:18px;bottom:92px;z-index:85;
  width:58px;height:58px;border-radius:50%;display:grid;place-items:center;
  color:#3a2a00;background:linear-gradient(140deg,#ffd97c,#f0b429);
  border:none;cursor:pointer;padding:0;
  box-shadow:0 14px 32px -8px rgba(240,180,41,.65);
  transition:transform .25s ease,opacity .25s ease;
}
.chat-launcher:hover{transform:scale(1.08)}
.chat-launcher svg{animation:launcherNod 3.4s ease-in-out infinite}
@keyframes launcherNod{0%,86%,100%{transform:rotate(0)}90%{transform:rotate(-8deg)}94%{transform:rotate(6deg)}98%{transform:rotate(-4deg)}}
.chat-launcher-dot{
  position:absolute;top:2px;right:2px;width:14px;height:14px;border-radius:50%;
  background:#ff4757;border:2.5px solid #fff;
}
body.chat-open .chat-launcher{display:none}

/* ---------- Teaser bubble ---------- */
.chat-teaser{
  position:fixed;right:20px;bottom:162px;z-index:84;
  max-width:250px;background:rgba(255,255,255,.97);color:var(--ink, #15233f);
  border-radius:16px 16px 4px 16px;padding:.8rem .95rem;cursor:pointer;
  border:1px solid rgba(20,40,95,.1);
  box-shadow:0 18px 44px -14px rgba(23,43,100,.45);
  opacity:0;transform:translateY(8px);pointer-events:none;
  transition:opacity .35s ease,transform .35s ease;
}
.chat-teaser.show{opacity:1;transform:none;pointer-events:auto}
.chat-teaser p{font-size:.83rem;line-height:1.45;font-weight:600;margin:0}
.chat-teaser i{position:absolute;bottom:-7px;right:18px;width:14px;height:14px;background:#fff;transform:rotate(45deg);border-radius:2px}
body.chat-open .chat-teaser{display:none}

/* ---------- Panel chat ---------- */
.chat-panel{
  position:fixed;right:14px;bottom:14px;z-index:95;
  width:min(384px,calc(100vw - 24px));
  height:min(620px,calc(100dvh - 24px));
  display:flex;flex-direction:column;overflow:hidden;
  background:rgba(255,255,255,.98);
  border:1px solid rgba(20,40,95,.14);border-radius:22px;
  box-shadow:0 40px 100px -22px rgba(23,43,100,.5),0 0 0 1px rgba(255,255,255,.5);
  opacity:0;transform:translateY(16px) scale(.96);transform-origin:bottom right;
  pointer-events:none;transition:opacity .3s ease,transform .3s cubic-bezier(.16,1,.3,1);
}
body.chat-open .chat-panel{opacity:1;transform:none;pointer-events:auto}

.chat-head{
  flex:none;display:flex;align-items:center;gap:.7rem;
  padding:.85rem 1rem;
  background:linear-gradient(120deg,#0a1d4e 0%,#0c3a63 60%,#0b5c46 130%);
  border-bottom:1px solid rgba(255,255,255,.12);
}
.chat-avatar{
  flex:none;width:42px;height:42px;display:grid;place-items:center;font-size:1.45rem;
  border-radius:50%;background:linear-gradient(140deg,#ffd97c,#f0b429);
  box-shadow:0 6px 16px -4px rgba(240,180,41,.55);
}
.chat-head-txt{flex:1;min-width:0}
.chat-head-txt strong{display:block;font-size:.95rem;font-weight:800;color:#fff;line-height:1.25}
.chat-head-txt small{display:flex;align-items:center;gap:.35rem;font-size:.7rem;color:#9ee8cf}
.chat-head-txt small i{width:7px;height:7px;border-radius:50%;background:#2bd56e;box-shadow:0 0 0 3px rgba(43,213,110,.22);animation:blinkDot 2s infinite}
@keyframes blinkDot{0%,100%{opacity:1}50%{opacity:.45}}
.chat-head-wa{
  flex:none;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;
  color:#fff;background:linear-gradient(140deg,#2bd56e,#129e4b);
  transition:transform .2s ease;
}
.chat-head-wa:hover{transform:scale(1.1)}
.chat-close{
  flex:none;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;
  color:#c6d2ea;background:rgba(255,255,255,.12);font-size:.9rem;line-height:1;
  transition:background .2s,color .2s;
}
.chat-close:hover{background:rgba(255,255,255,.24);color:#fff}

/* ---------- Body / pesan ---------- */
.chat-body{
  flex:1;overflow-y:auto;padding:1rem .9rem;display:flex;flex-direction:column;gap:.65rem;
  scroll-behavior:smooth;
  background:linear-gradient(180deg,#f6f9ff,#eef4ff);
}
.chat-body::-webkit-scrollbar{width:6px}
.chat-body::-webkit-scrollbar-thumb{background:rgba(20,40,95,.2);border-radius:99px}
.chat-msg{display:flex;max-width:86%}
.chat-msg.user{align-self:flex-end}
.chat-msg.bot{align-self:flex-start}
.chat-bubble{
  font-size:.9rem;line-height:1.55;padding:.65rem .85rem;word-wrap:break-word;
  animation:msgIn .3s cubic-bezier(.16,1,.3,1);
}
@keyframes msgIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.chat-msg.user .chat-bubble{
  background:linear-gradient(135deg,#19e3a4,#0ab383);color:#04301f;font-weight:600;
  border-radius:16px 16px 4px 16px;
}
.chat-msg.bot .chat-bubble{
  background:#fff;border:1px solid rgba(20,40,95,.12);color:#22314f;
  border-radius:16px 16px 16px 4px;
  box-shadow:0 8px 20px -12px rgba(23,43,100,.35);
}
.chat-bubble strong{color:#067a5c}
.chat-bubble br{display:block;content:"";margin:.4rem 0}

/* typing indicator */
.chat-typing{display:inline-flex;gap:5px;align-items:center;padding:.78rem .95rem}
.chat-typing span{width:7px;height:7px;border-radius:50%;background:#7fa3c0;animation:typingBounce 1.2s infinite}
.chat-typing span:nth-child(2){animation-delay:.18s}
.chat-typing span:nth-child(3){animation-delay:.36s}
@keyframes typingBounce{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}

/* tombol aksi di dalam pesan bot */
.chat-act{
  display:block;margin-top:.7rem;text-align:center;
  background:linear-gradient(135deg,#ffd97c,#f0b429);color:#3a2a00;
  font-weight:800;font-size:.87rem;padding:.65rem .9rem;border-radius:999px;
  transition:transform .2s ease,box-shadow .2s ease;
  box-shadow:0 8px 20px -8px rgba(240,180,41,.6);
}
.chat-act:hover{transform:translateY(-2px)}

/* ---------- Chips pertanyaan cepat ---------- */
.chat-chips{
  flex:none;display:flex;gap:.5rem;overflow-x:auto;padding:.55rem .9rem .2rem;
  background:#fff;scrollbar-width:none;
}
.chat-chips::-webkit-scrollbar{display:none}
.chat-chip{
  flex:none;white-space:nowrap;font-size:.78rem;font-weight:700;color:#067a5c;
  background:rgba(11,170,126,.1);border:1px solid rgba(11,170,126,.32);
  border-radius:999px;padding:.5rem .85rem;cursor:pointer;
  transition:background .2s,transform .2s;
}
.chat-chip:hover{background:rgba(11,170,126,.22);transform:translateY(-1px)}

/* ---------- Input ---------- */
.chat-form{
  flex:none;display:flex;gap:.5rem;padding:.7rem .8rem .85rem;
  border-top:1px solid rgba(20,40,95,.08);background:#fff;
}
.chat-form input{
  flex:1;min-width:0;font:inherit;font-size:.9rem;color:var(--ink, #15233f);
  background:#f2f6fd;border:1px solid rgba(20,40,95,.14);
  border-radius:999px;padding:.62rem 1rem;outline:none;
  transition:border-color .2s,background .2s;
}
.chat-form input::placeholder{color:#8d99b4}
.chat-form input:focus{border-color:rgba(11,170,126,.55);background:#fff}
.chat-form button{
  flex:none;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;
  color:#04301f;background:linear-gradient(135deg,#19e3a4,#0ab383);cursor:pointer;
  transition:transform .2s ease;
}
.chat-form button:hover{transform:scale(1.07)}

/* ---------- Mobile ---------- */
@media (max-width:480px){
  .chat-panel{right:10px;bottom:10px;width:calc(100vw - 20px);height:calc(100dvh - 20px);border-radius:20px}
  .chat-teaser{right:12px;bottom:158px;max-width:224px}
}
@media (max-width:360px){
  .chat-teaser{display:none}
}
