.csi-chatbot-widget,
.csi-chatbot-widget *,
.csi-chatbot-widget *::before,
.csi-chatbot-widget *::after {
  box-sizing: border-box;
}

.csi-chatbot-widget {
  position: fixed;
  bottom: 105px;
  right: 30px;
  z-index: 9999;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  gap: 12px;
}

.csi-chatbot-tooltip {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  position: relative;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}
.csi-chatbot-tooltip::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left-color: #7c3aed;
}

.csi-chatbot-widget.open .csi-chatbot-tooltip {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9) translateX(-10px);
}

.csi-chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  outline: none;
  position: relative;
}

.csi-chatbot-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.5);
}

.csi-chatbot-toggle.active {
  transform: scale(0.9);
  opacity: 0;
  pointer-events: none;
}

.csi-chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 120px);
  background: #0a0a0f;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

.csi-chatbot-widget.open .csi-chatbot-window {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.csi-chatbot-widget.open .csi-chatbot-toggle {
  display: none;
}

.csi-chatbot-close-float {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1e293b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.csi-chatbot-widget.open .csi-chatbot-close-float {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

.csi-chatbot-close-float:hover {
  background: #334155;
  transform: scale(1.05);
}

/* Chatbot Header */
.csi-chat-header {
  padding: 16px;
  background: rgba(20, 20, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.csi-chat-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
  color: white;
}

.csi-chat-header-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px 0;
}

.csi-chat-header-text p {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
}

.csi-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.csi-chat-close:hover {
  color: #fff;
}

/* Chatbot Messages */
.csi-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #0a0a0f;
  scroll-behavior: smooth;
}

.csi-chat-messages::-webkit-scrollbar { width: 6px; }
.csi-chat-messages::-webkit-scrollbar-track { background: transparent; }
.csi-chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

.csi-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: csi-msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.csi-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

@keyframes csi-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.csi-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

.csi-msg-bot .csi-msg-avatar {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
}

.csi-msg-user .csi-msg-avatar {
  background: linear-gradient(135deg, #374151, #4b5563);
}

.csi-msg-bubble {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #e2e8f0;
  word-wrap: break-word;
  word-break: break-word;
}

.csi-msg-bot .csi-msg-bubble {
  background: rgba(30, 35, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

.csi-msg-user .csi-msg-bubble {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.csi-msg-bubble p { margin: 0 0 8px 0; }
.csi-msg-bubble p:last-child { margin-bottom: 0; }
.csi-msg-bubble strong { color: #60a5fa; font-weight: 600; }
.csi-msg-user .csi-msg-bubble strong { color: #fff; }
.csi-msg-bubble ul { padding-left: 18px; margin: 8px 0; }
.csi-msg-time { display: block; font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 6px; text-align: right; }

/* Welcome Area */
.csi-chat-welcome {
  text-align: center;
  padding: 10px 0 20px;
}

.csi-chat-welcome h4 {
  color: #fff;
  font-size: 16px;
  margin: 0 0 6px 0;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.csi-chat-welcome p {
  color: #94a3b8;
  font-size: 13px;
  margin: 0 0 20px 0;
}

.csi-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.csi-suggestion {
  background: rgba(30, 35, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  color: #e2e8f0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.csi-suggestion:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.4);
}

.csi-suggestion span { font-size: 18px; }
.csi-suggestion-text { font-size: 13px; font-weight: 500; }

/* Input Area */
.csi-chat-input {
  padding: 16px;
  background: rgba(20, 20, 30, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.csi-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.csi-chat-input textarea {
  flex: 1;
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 100px;
  transition: border-color 0.2s;
}

.csi-chat-input textarea:focus {
  border-color: #2563eb;
}

.csi-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.csi-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #334155;
}

.csi-send-btn:not(:disabled):hover {
  transform: scale(1.05);
}

/* Typing */
.csi-typing-dots {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: rgba(30, 35, 50, 0.8);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.csi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  animation: csi-typing 1.4s infinite ease-in-out;
}
.csi-dot:nth-child(2) { animation-delay: 0.2s; }
.csi-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes csi-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 480px) {
  .csi-chatbot-window {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
}

@media (max-width: 480px) { 
  .csi-chatbot-widget { bottom: 95px; right: 20px; } 
  .csi-chatbot-tooltip { display: none; }
}

.csi-whatsapp-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}
.csi-whatsapp-cta i {
  font-size: 1.2rem;
}
.csi-whatsapp-cta:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(18, 140, 126, 0.3);
}
