* {
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
  background: #f5f5f5;
  margin: 0;
}

/* ======================
   CHAT CONTAINER
====================== */
.chat-container {
  width: 380px;
  height: 600px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: auto;
  margin-top: 40px;
}

/* ======================
   HEADER
====================== */
.chat-header {
  background: linear-gradient(135deg, #ff9800, #ff6f00);
  color: white;
  padding: 16px;
  font-weight: bold;
  text-align: center;
}

/* ======================
   BODY (SCROLLABLE)
====================== */
.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fafafa;
  padding-bottom: 90px; /* ruang untuk input fixed */
}

/* ======================
   MESSAGE
====================== */
.chat-message {
  display: flex;
  margin-bottom: 12px;
}

.chat-message.bot {
  justify-content: flex-start;
}

.chat-message.bot .bubble {
  background: #eeeeee;
  color: #333;
  border-radius: 12px 12px 12px 4px;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.user .bubble {
  background: #ff9800;
  color: white;
  border-radius: 12px 12px 4px 12px;
}

.bubble {
  max-width: 70%;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
}

/* ======================
   INPUT (FIXED BOTTOM)
====================== */
.chat-input {
  position: fixed;
  bottom: 0;
  width: 380px;
  display: flex;
  padding: 12px;
  border-top: 1px solid #ddd;
  background: #fff;
  z-index: 10;
}

.chat-input input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 20px;
  border: 1px solid #ccc;
  outline: none;
}

.chat-input button {
  margin-left: 8px;
  padding: 10px 16px;
  background: #ff9800;
  border: none;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.chat-input button:hover {
  background: #fb8c00;
}

/* ======================
   SPINNER
====================== */
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #ddd;
  border-top: 3px solid #ff9800;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader .bubble {
  padding: 10px 14px;
}

/* ======================
   RESPONSIVE MOBILE
====================== */
@media (max-width: 600px) {

  body {
    background: #ffffff;
  }

  .chat-container {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .chat-input {
    width: 100%;
  }

  .bubble {
    max-width: 85%;
    font-size: 14px;
  }
}
