/* ===== Chatbox Widget — Sucang Oma Yati ===== */
:root {
  --cb-pandan-dark: #2D4A3E;
  --cb-pandan-mid: #4A6B58;
  --cb-pandan-light: #7AA68C;
  --cb-soy-dark: #5D4E37;
  --cb-cream: #F5F2ED;
}

/* Tombol mengambang (launcher) */
.cb-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--cb-pandan-mid), var(--cb-pandan-dark));
  color: #fff;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(45, 74, 62, 0.4);
  z-index: 1200;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cb-fab:hover { transform: scale(1.08); box-shadow: 0 12px 32px rgba(45,74,62,.5); }
.cb-fab .cb-dot {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #ff5a5f; border: 2px solid var(--cb-cream);
}

/* Panel */
.cb-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(45,74,62,.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1200;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.cb-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* Header */
.cb-head {
  background: linear-gradient(135deg, var(--cb-pandan-mid), var(--cb-pandan-dark));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cb-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.cb-head-info h4 { margin: 0; font-size: 1rem; font-family: 'Poppins', sans-serif; font-weight: 600; }
.cb-head-info p { margin: 0; font-size: .75rem; opacity: .85; }
.cb-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6dff9e; margin-right: 4px; }
.cb-close {
  margin-left: auto; background: none; border: none; color: #fff;
  font-size: 1.4rem; cursor: pointer; opacity: .8; line-height: 1;
}
.cb-close:hover { opacity: 1; }

/* Pesan */
.cb-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--cb-cream); display: flex; flex-direction: column; gap: 10px; }
.cb-msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.5; word-wrap: break-word; }
.cb-msg.bot { background: #fff; color: var(--cb-soy-dark); border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: 0 2px 8px rgba(93,78,55,.08); }
.cb-msg.user { background: linear-gradient(135deg, var(--cb-pandan-mid), var(--cb-pandan-dark)); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.cb-msg a { color: var(--cb-pandan-mid); text-decoration: underline; }
.cb-msg.user a { color: #fff; }

/* mengetik... */
.cb-typing { align-self: flex-start; background: #fff; border-radius: 16px; border-bottom-left-radius: 4px; padding: 12px 16px; display: flex; gap: 5px; box-shadow: 0 2px 8px rgba(93,78,55,.08); }
.cb-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--cb-pandan-light); animation: cbBlink 1.2s infinite; }
.cb-typing span:nth-child(2) { animation-delay: .2s; }
.cb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes cbBlink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* Quick reply chips */
.cb-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; background: var(--cb-cream); }
.cb-chip { background: #fff; border: 1px solid var(--cb-pandan-light); color: var(--cb-pandan-dark); padding: 7px 12px; border-radius: 20px; font-size: .8rem; cursor: pointer; transition: all .2s; }
.cb-chip:hover { background: var(--cb-pandan-mid); color: #fff; }

/* Input */
.cb-inputbar { display: flex; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid rgba(93,78,55,.08); }
.cb-input { flex: 1; border: 1px solid rgba(93,78,55,.15); border-radius: 22px; padding: 10px 14px; font-size: .9rem; font-family: 'Poppins', sans-serif; outline: none; }
.cb-input:focus { border-color: var(--cb-pandan-mid); }
.cb-send { border: none; background: linear-gradient(135deg, var(--cb-pandan-mid), var(--cb-pandan-dark)); color: #fff; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; flex-shrink: 0; transition: transform .2s; }
.cb-send:hover { transform: scale(1.06); }

@media (max-width: 420px) {
  .cb-panel { right: 12px; bottom: 88px; width: calc(100vw - 24px); height: 70vh; }
  .cb-fab { bottom: 16px; right: 16px; width: 54px; height: 54px; }
}
