/* Chatbot Base Styles */
.chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 35px;
  outline: none;
  border: none;
  height: 50px;
  width: 50px;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #149ddd;
  transition: all 0.2s ease;
  z-index: 9999;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.chatbot-toggler:hover {
  transform: scale(1.1);
  background: #0d7db3;
}

.chatbot-toggler i {
  color: #fff;
  position: absolute;
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

.chatbot-toggler i:first-child {
  opacity: 1;
}

.chatbot-toggler i:last-child {
  opacity: 0;
  transform: rotate(-90deg);
}

.show-chatbot .chatbot-toggler i:first-child {
  opacity: 0;
}

.show-chatbot .chatbot-toggler i:last-child {
  opacity: 1;
  transform: rotate(0deg);
}

/* Chatbot Panel */
.chatbot-wrapper {
  position: fixed;
  right: 35px;
  bottom: 90px;
  width: 350px;
  background: #040b14;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: bottom right;
  transition: all 0.1s ease;
  z-index: 9999;
  box-shadow: 0 0 128px 0 rgba(0,0,0,0.1),
              0 32px 64px -48px rgba(0,0,0,0.5);
  border: 1px solid #149ddd;
}

.show-chatbot .chatbot-wrapper {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.chatbot-header {
  padding: 16px 20px;
  position: relative;
  text-align: center;
  color: #fff;
  background: #149ddd;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header h2 {
  font-size: 1.1rem;
  margin: 0;
  color: #fff;
  font-weight: 600;
}

.chatbot-header .close-btn {
  cursor: pointer;
  font-size: 1.5rem;
  transition: 0.2s;
}

.chatbot-header .close-btn:hover {
  transform: rotate(90deg);
}

.chat-box {
  overflow-y: auto;
  height: 400px;
  padding: 20px;
  scroll-behavior: smooth;
  margin: 0;
}

.chat-box::-webkit-scrollbar {
  width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
  background: #149ddd;
  border-radius: 10px;
}

.chat-box .chat {
  display: flex;
  list-style: none;
}

.chat-box .chat p {
  word-wrap: break-word;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.5;
}

.chat-box .outgoing p {
  background: #149ddd;
  color: #fff;
  border-radius: 10px 10px 0 10px;
  max-width: 85%;
}

.chat-box .incoming p {
  background: #1a232f;
  color: #e6e6e6;
  border-radius: 10px 10px 10px 0;
  max-width: 85%;
  border: 1px solid #283a5ae6;
}

.chat-box .incoming {
  margin-bottom: 15px;
}

.chat-box .outgoing {
  margin-bottom: 15px;
  justify-content: flex-end;
}

/* Typing animation */
.chat-box .incoming p.typing-animation {
  padding: 12px 15px;
}

.typing-animation .typing-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  margin: 0 3px;
  opacity: 0.7;
  display: inline-block;
  background: #149ddd;
  animation: typing 1.5s infinite ease-in-out;
}

.typing-animation .typing-dot:nth-child(1) {
  animation-delay: 0s;
}
.typing-animation .typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-animation .typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Input area */
.chat-input {
  display: flex;
  gap: 5px;
  background: #040b14;
  padding: 10px 20px;
  border-top: 1px solid #149ddd;
  align-items: center;
}

.chat-input textarea {
  height: 55px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  max-height: 180px;
  padding: 16px 15px 16px 0;
  font-size: 0.95rem;
  background: transparent;
  color: #fff;
}

.chat-input textarea::placeholder {
  color: #888;
}

.chat-input textarea::-webkit-scrollbar {
  width: 0px;
}

.chat-input button {
  border: none;
  outline: none;
  background: transparent;
  color: #149ddd;
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input button:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 490px) {
  .chatbot-wrapper {
    right: 15px;
    bottom: 80px;
    width: 320px;
  }
}
