.chatbot-btn {
  position: fixed;
  bottom: 95px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #039be5;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(3, 155, 229, .35);
  transition: all .3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(3, 155, 229, .3);
  animation: ripple 2s ease-out infinite;
}

@keyframes ripple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

.chatbot-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(3, 155, 229, .5);
}

.chatbot-btn .close-icon {
  display: none;
}

.chatbot-btn.open .chat-icon {
  display: none;
}

.chatbot-btn.open .close-icon {
  display: inline;
}

.chatbot-btn.open::after {
  display: none;
}

.chatbot-widget {
  position: fixed;
  bottom: 165px;
  right: 28px;
  width: 360px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .15);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  animation: slideUp .3s ease;
}

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

.chatbot-widget.open {
  display: flex;
}

.chatbot-header {
  background: #039be5;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.chatbot-header-info {
  flex: 1;
  min-width: 0;
}

.chatbot-header-info h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: #fff;
}

.chatbot-header-info p {
  font-size: 11px;
  margin: 0;
  opacity: .85;
  color: #fff;
}

.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  max-height: 340px;
  background: #f8fafc;
}

.chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: msgIn .25s ease;
}

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

.chatbot-msg.user {
  align-self: flex-end;
  background: #039be5;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chatbot-msg.bot {
  align-self: flex-start;
  background: #e9eef4;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.bot p {
  margin: 0 0 6px;
}

.chatbot-msg.bot p:last-child {
  margin-bottom: 0;
}

.chatbot-msg.bot strong {
  font-weight: 600;
}

.chatbot-msg.bot a {
  color: #039be5;
  text-decoration: underline;
  font-weight: 500;
}

.chatbot-msg.bot ul,
.chatbot-msg.bot ol {
  margin: 4px 0;
  padding-left: 18px;
}

.chatbot-msg.bot li {
  margin-bottom: 2px;
}

.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #e9eef4;
  align-self: flex-start;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) { animation-delay: .2s; }
.chatbot-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(.8); opacity: .5; }
  40% { transform: scale(1.2); opacity: 1; }
}

.chatbot-msg-typing .cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: #039be5;
  margin-left: 2px;
  animation: blink .8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

.chatbot-footer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.chatbot-input-wrap {
  flex: 1;
  position: relative;
}

.chatbot-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 100px;
  transition: border-color .2s;
  box-sizing: border-box;
}

.chatbot-input:focus {
  border-color: #039be5;
  box-shadow: 0 0 0 2px rgba(3, 155, 229, .12);
}

.chatbot-input-char {
  position: absolute;
  right: 8px;
  bottom: 4px;
  font-size: 10px;
  color: #94a3b8;
  pointer-events: none;
}

.chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #039be5;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.chatbot-send:hover {
  background: #0288d1;
}

.chatbot-send:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.chatbot-error {
  color: #dc2626;
  font-size: 12px;
  padding: 4px 16px;
  text-align: center;
  background: #fef2f2;
}

@media (max-width: 480px) {
  .chatbot-btn {
    bottom: 20px;
    right: 16px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .chatbot-widget {
    left: 10px;
    right: 10px;
    bottom: 80px;
    width: auto;
    max-height: 80vh;
  }

  .chatbot-messages {
    max-height: 50vh;
    min-height: 150px;
  }
}
