body {
  font-family: Arial, sans-serif;
}

/* BUTTON AWAL */
.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, #6dd5fa, #2980b9);
  padding: 10px 15px;
  border-radius: 50px;
  cursor: pointer;
  color: white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.actions button {
  width: 25px;
  height: 25px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  line-height: 1;

  cursor: pointer;
}


.chat-button .robot {
  width: 50px;
  height: 50px;
  margin-right: 10px;
  object-fit: cover;      /* biar tidak gepeng */
  border-radius: 50%;     /* jadi bulat */
}

.chat-text h4 {
  margin: 0;
  font-size: 14px;
}

.chat-text p {
  margin: 0;
  font-size: 12px;
}

/* CHAT BOX */
.chat-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 500px;
  height: 700px;
  max-width: calc(100vw - 40px);  /* tidak akan lebih lebar dari layar */
  max-height: calc(100vh - 40px); /* tidak akan lebih tinggi dari layar */
  background: #b0b5bb;
  border-radius: 20px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.chat-box.minimized {
  height: 60px; /* hanya tampil header */
}
.chat-box.minimized .chat-body,
.chat-box.minimized .chat-footer {
  display: none;
}

/* HEADER */
.chat-header {
  background: #1e3c72;
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;  /* ← supaya gambar sejajar vertikal */
}

.header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  background: white; /* fallback kalau video belum load */
}

/* BODY */
.chat-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;           /* ← tambah */
  flex-direction: column;  /* ← tambah */
}

.bot-subtext {
  font-size: 10px;
  color: #000000;
  margin-top: 6px;
  line-height: 1.4;
}

.bot-message {
  background: white;
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 10px;
  max-width: 70%;
  align-self: flex-start;     /* ← tambah */
   width: fit-content;    /* ← lebar mengikuti isi teks */
  word-wrap: break-word; /* ← teks panjang otomatis turun ke baris baru */
  white-space: pre-wrap; /* ← menghormati enter/newline dari textarea */
  line-height: 1.5;
  
}

/* ← tambah class baru ini */
.user-message {
  background: #1e3c72;
  color: white;
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 10px;
  max-width: 70%;
  align-self: flex-end;       /* ← ini yang bikin ke kanan */
  width: fit-content;    /* ← lebar mengikuti isi teks */
  word-wrap: break-word; /* ← teks panjang otomatis turun ke baris baru */
  white-space: pre-wrap; /* ← menghormati enter/newline dari textarea */
  line-height: 1.5;
}

/* FOOTER */
.chat-footer {
 display: flex;
  align-items: center;
  padding: 10px;
  background: #1e3c72;
  gap: 8px;
}

/* .chat-footer input {
    padding: 8px 12px;
  border-radius: 20px;
  border: none;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
} */

/* tombol kirim */
.send-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0;
  font-size: 18px;
  cursor: pointer;
}

.send-btn:focus {
  outline: none;
}

.send-btn:hover {
  color: #4bbce2;
}

.chat-footer textarea {
  padding: 10px 40px 10px 12px;
  border-radius: 14px;
  border: none;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  resize: none;           /* ← hilangkan handle resize manual */
  overflow: hidden;       /* ← sembunyikan scrollbar */
  line-height: 1.4;
  max-height: 100px;      /* ← batas maksimum tinggi */
  font-family: Arial, sans-serif;
}


.chat-footer span {
  font-size: 10px;          /* ← ukuran kecil */
  color: #aaaaaa;           /* ← warna abu-abu */
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.char-counter {
  position: absolute;
  bottom: 4px;
  left: 12px;
  font-size: 10px;
}

video {
  display: block;
}

.chat-button:hover {
  transform: scale(1.05);
  transition: 0.2s;
}