* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #d1d7db;
  background-image: linear-gradient(180deg, #00a884 0%, #00a884 127px, #d1d7db 127px, #d1d7db 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 520px;
  height: 88vh;
  max-height: 760px;
  background: #efeae2;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(11, 20, 26, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header ala WhatsApp */
.chat-header {
  background-color: #008069;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dfe5e7;
  color: #008069;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  background-color: #25d366;
  border: 2px solid #008069;
  border-radius: 50%;
}

.contact-info h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  text-align: left;
  line-height: 1.2;
}

.contact-info p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

/* Area Chat - Berurutan Atas ke Bawah (Flex Column) */
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(11, 20, 26, 0.05) 1px, transparent 0);
  background-size: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Bubble Pesan */
.message {
  position: relative;
  max-width: 78%;
  padding: 8px 12px 6px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.45;
  color: #111b21;
  box-shadow: 0 1px 1.5px rgba(11, 20, 26, 0.13);
  word-wrap: break-word;
  white-space: pre-wrap;
  display: flex;
  flex-direction: column;
}

/* Pesan User di Kanan */
.message.user {
  align-self: flex-end;
  background-color: #d9fdd3;
  border-top-right-radius: 0;
}

/* Pesan Bot di Kiri */
.message.bot {
  align-self: flex-start;
  background-color: #ffffff;
  border-top-left-radius: 0;
}

.message-text {
  word-break: break-word;
}

.message-time {
  font-size: 10.5px;
  color: #667781;
  align-self: flex-end;
  margin-top: 3px;
  margin-left: 8px;
  user-select: none;
}

/* Input Bar Bawah */
.chat-input-area {
  background-color: #f0f2f5;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input-area input[type="text"] {
  flex: 1;
  padding: 11px 16px;
  border-radius: 24px;
  border: none;
  background-color: #ffffff;
  font-size: 15px;
  color: #111b21;
  outline: none;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.06);
}

.chat-input-area input[type="text"]::placeholder {
  color: #8696a0;
}

.chat-input-area input[type="text"]:disabled {
  background-color: #e9edef;
  cursor: not-allowed;
}

.chat-input-area button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background-color: #00a884;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.chat-input-area button:hover:not(:disabled) {
  background-color: #008f6f;
}

.chat-input-area button:active:not(:disabled) {
  transform: scale(0.95);
}

.chat-input-area button:disabled {
  background-color: #8696a0;
  cursor: not-allowed;
}
