/* Chatbot Styling - Green Theme */
.chat-header a {
  text-decoration: none;
  color: white;
}

#chatbot-popup {
  display: none;
}

.copyright {
  font-size: 12px;
  text-align: center;
  padding-bottom: 10px;
}

.copyright a {
  text-decoration: none;
  color: #343c41;
}

#chatbot-toggle-btn {
  position: fixed;
  bottom: 90px;
  right: 25px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1001;
}

.chatbot-popup {
  display: none;
  position: fixed;
  bottom: 150px;
  right: 25px;
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  width: 350px;
  max-width: 90%;
  z-index: 1000;
}

.chat-header {
  background-color: #10b981; /* Green color */
  color: #fff;
  padding: 15px 20px;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#close-btn {
  background-color: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.chat-box {
  max-height: 350px;
  overflow-y: auto;
  padding: 15px 20px;
}

.chat-input {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  border-top: 1px solid #ddd;
}

#user-input {
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif; /* Font lebih smooth */
  font-size: 14px;
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.3s ease;
}

#user-input:focus {
  border-color: #10b981;
}

#send-btn {
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif;
  padding: 10px 20px;
  border: none;
  background-color: #10b981; /* Green color */
  color: #fff;
  border-radius: 12px;
  margin-left: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#send-btn:hover {
  background-color: #059669; /* Darker green on hover */
}

.user-message {
  background-color: #f3f3f3;
  color: #333;
  padding: 14px;
  border-radius: 15px;
  margin-bottom: 15px;
  margin-top: 15px;
  margin-left: 10px;
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  /* Perbaikan: Force text wrap */
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-width: 85%;
}

.user-message::before {
  content: "\1F468"; /* Man emoji */
  position: absolute;
  bottom: -17px;
  right: -20px;
  margin-bottom: 7px;
  font-size: 20px;
  background-color: #10b981; /* Green color */
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.bot-message {
  background-color: #10b981; /* Green color */
  color: #fff;
  padding: 14px;
  border-radius: 15px;
  margin-bottom: 10px;
  margin-top: 15px;
  align-self: flex-start;
  margin-right: 10px;
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  /* Perbaikan: Force text wrap */
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-width: 85%;
}

.bot-message::before {
  content: "\1F916"; /* Robot emoji */
  position: absolute;
  bottom: -17px;
  left: -14px;
  margin-bottom: 4px;
  font-size: 20px;
  background-color: #10b981; /* Green color */
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.button-container {
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
}

.button-container button {
  padding: 10px 50px;
  border: none;
  background-color: #10b981; /* Green color */
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.button-container button:hover {
  background-color: #059669; /* Darker green on hover */
}

/* Loading Animation (Typing Indicator) */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  padding: 14px;
  background-color: #10b981;
  color: #fff;
  border-radius: 15px;
  margin-bottom: 10px;
  margin-top: 15px;
  align-self: flex-start;
  margin-right: 10px;
  position: relative;
}

.typing-indicator::before {
  content: "\1F916";
  position: absolute;
  bottom: -17px;
  left: -14px;
  margin-bottom: 4px;
  font-size: 20px;
  background-color: #10b981;
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #fff;
  border-radius: 50%;
  display: inline-block;
  margin: 0 3px;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.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(-8px);
    opacity: 1;
  }
}

/* Scrollbar Styling */
.chat-box::-webkit-scrollbar {
  width: 6px;
}

.chat-box::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 10px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
  background: #059669;
}

/* URL Button Styling */
.url-button {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.url-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Jika URL button di user message (background terang) */
.user-message .url-button {
  background-color: #10b981;
  color: #fff;
  border: 1px solid #10b981;
}

.user-message .url-button:hover {
  background-color: #059669;
  border-color: #059669;
}