/* AI OmniBot Stylesheet - Clean, modern, responsive */
.ai-chatbot-container {
  position: fixed;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
}

.ai-pos-bottom-right {
  bottom: 24px;
  right: 24px;
}

.ai-pos-bottom-left {
  bottom: 24px;
  left: 24px;
}

/* Floating Launcher Button */
.ai-chatbot-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--ai-cb-primary, #0284c7);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  position: relative;
  outline: none;
}

.ai-chatbot-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(2, 132, 199, 0.5);
  background: var(--ai-cb-primary-dark, #0369a1);
}

.ai-chatbot-launcher .ai-launcher-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chatbot-launcher .ai-launcher-close {
  display: none;
}

.ai-chatbot-container.ai-chat-open .ai-chatbot-launcher .ai-launcher-icon {
  display: none;
}

.ai-chatbot-container.ai-chat-open .ai-chatbot-launcher .ai-launcher-close {
  display: flex;
}

.ai-unread-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}

/* Chat Window */
.ai-chatbot-window {
  position: absolute;
  bottom: 74px;
  width: 380px;
  height: 560px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ai-slide-up 0.25s ease-out;
  border: 1px solid #e2e8f0;
}

.ai-pos-bottom-right .ai-chatbot-window {
  right: 0;
}

.ai-pos-bottom-left .ai-chatbot-window {
  left: 0;
}

@keyframes ai-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.ai-chat-header {
  background: var(--ai-cb-primary, #0284c7);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.ai-header-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.ai-online-status {
  font-size: 11px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-status-indicator {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}

.ai-action-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.ai-action-btn:hover {
  opacity: 1;
}

/* Chat Body & Messages */
.ai-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-body::-webkit-scrollbar {
  width: 5px;
}
.ai-chat-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.ai-msg-bot {
  align-self: flex-start;
}

.ai-msg-user {
  align-self: flex-end;
}

.ai-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
}

.ai-msg-bot .ai-msg-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ai-msg-user .ai-msg-bubble {
  background: var(--ai-cb-primary, #0284c7);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.ai-msg-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  padding: 0 4px;
}

.ai-msg-user .ai-msg-time {
  text-align: right;
}

/* Quick Action Chips */
.ai-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--ai-cb-primary, #0284c7);
  color: var(--ai-cb-primary, #0284c7);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.ai-chip svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.ai-chip:hover {
  background: var(--ai-cb-primary, #0284c7);
  color: #ffffff;
}

/* Interactive Cards (Order / Login) */
.ai-interactive-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  margin: 6px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ai-interactive-card h5 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.ai-card-sub {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #64748b;
}

.ai-card-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.ai-input:focus {
  border-color: var(--ai-cb-primary, #0284c7);
}

.ai-btn-primary {
  background: var(--ai-cb-primary, #0284c7);
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ai-btn-text {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
}

.ai-card-error {
  color: #dc2626;
  font-size: 12px;
}

/* Product Cards in Chat */
.ai-products-deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ai-product-card {
  display: flex;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ai-product-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
}

.ai-product-details {
  padding: 8px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ai-product-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-product-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--ai-cb-primary, #0284c7);
}

.ai-product-price .old-price {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 11px;
  margin-right: 4px;
}

/* Order Result Card */
.ai-order-summary-card {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
  font-size: 12.5px;
}

.ai-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.ai-order-status-badge {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 11px;
}

/* Typing Indicator */
.ai-typing {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  align-self: flex-start;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  width: fit-content;
  margin: 0 16px 8px 16px;
}

.ai-typing span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: ai-bounce 1.4s infinite ease-in-out both;
}
.ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Feedback Bar */
.ai-feedback-bar {
  padding: 6px 14px;
  background: #f1f5f9;
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
}

.ai-feedback-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}
.ai-feedback-btn:hover {
  background: #e2e8f0;
}

/* Footer & Input */
.ai-chat-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 10px 14px;
}

.ai-input-wrap {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 4px 6px 4px 14px;
}

.ai-input-wrap:focus-within {
  border-color: var(--ai-cb-primary, #0284c7);
  background: #ffffff;
}

.ai-input-wrap textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  resize: none;
  max-height: 80px;
  font-family: inherit;
  padding: 6px 0;
}

.ai-send-btn {
  background: var(--ai-cb-primary, #0284c7);
  color: #ffffff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  outline: none;
}

.ai-send-btn:hover {
  background: var(--ai-cb-primary-dark, #0369a1);
}

.ai-branding {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 6px;
}

/* Mobile full width responsiveness */
@media (max-width: 480px) {
  .ai-pos-bottom-right, .ai-pos-bottom-left {
    bottom: 16px;
    right: 16px;
    left: auto;
  }
  .ai-chatbot-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    z-index: 1000000;
  }
}
