.chat-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #3e3071 0%, #0e2735 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(42, 52, 140, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(21, 37, 81, 0.6);
}

.chat-button svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* Chat Container */
.chat-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  max-width: calc(100vw - 60px);
  height: 550px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  animation: slideUp 0.3s ease;
}

.chat-container.active {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #052858 0%, #003b5c 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.chat-header small {
  display: block;
  opacity: 0.9;
  font-size: 11px;
  margin-top: 2px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(18, 16, 136, 0.2);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #fafafa;
}

.message {
  margin-bottom: 12px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.bot {
  text-align: left;
}

.message.user {
  text-align: right;
}

.message-content {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 80%;
  word-wrap: break-word;
  white-space: pre-line;
  line-height: 1.5;
}

.message.bot .message-content {
  background: white;
  color: #333;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message.user .message-content {
  background: linear-gradient(135deg, #23256d 0%, #003b5c 100%);
  color: white;
  border-bottom-right-radius: 6px;
}

.back-btn {
  background: linear-gradient(135deg, #23256d 0%, #003b5c 100%);
  color: white;
  border-bottom-right-radius: 6px;
}

/* Quick Replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 0 14px;
  max-height: 160px;
  overflow-y: auto;
  padding-bottom: 10px;
}

.quick-reply-btn {
  background: white;
  border: 2px solid #003b5c;
  color: #003b5c;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-weight: 500;
  flex-grow: 1;
  text-align: center;
  white-space: nowrap;
}

.quick-reply-btn:hover {
  background: #003b5c;
  color: white;
  transform: translateY(-2px);
}

/* Chat Input - Dihapus */
.chat-input-container {
  display: none;
}

/* Language Selection */
.language-selection {
  text-align: center;
  padding: 20px;
}

.language-btn {
  background: linear-gradient(135deg, #23316b 0%, #003b5c 100%);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 20px;
  margin: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(107, 68, 35, 0.3);
}

.language-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(107, 68, 35, 0.4);
}

/* Human Takeover - WhatsApp Style */
.human-takeover {
  background: #dcf8c6;
  border: 1px solid #25d366;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 14px;
  text-align: center;
  font-size: 13px;
  color: #075e54;
}

.human-takeover button {
  background: #25d366;
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 15px;
  margin-top: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-left: auto;
  margin-right: auto;
}

.human-takeover button:hover {
  background: #128c7e;
  transform: scale(1.03);
}

.human-takeover .back-btn {
  background: linear-gradient(135deg, #23256d 0%, #003b5c 100%) !important;
  color: white !important;
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  padding: 12px 16px;
  background: white;
  border-radius: 18px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background: #003b5c;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #003b5c;
  border-radius: 3px;
}

/* Customer Service Button */
.customer-service-btn {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 5px 0;
  width: 100%;
}

.customer-service-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
  .chat-container {
    right: 10px;
    left: 10px;
    width: calc(100vw - 20px);
    bottom: 80px;
  }

  .chat-button {
    right: 20px;
    bottom: 20px;
  }
}
