/* ==========================================================================
   BABKE KEBAB & PLATES — FOOD RECOMMENDATION CHATBOT STYLESheet
   ========================================================================== */

/* 1. Floating Trigger Bubble */
.chatbot-trigger-bubble {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-primary, #ff5a1f);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 32px rgba(255, 90, 31, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-trigger-bubble:hover {
  transform: scale(1.1) translateY(-4px);
  background: var(--accent-primary-hover, #ff7a47);
  box-shadow: 0 12px 36px rgba(255, 90, 31, 0.45);
}

.chatbot-trigger-bubble .trigger-tooltip-txt {
  position: absolute;
  right: 75px;
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(15px);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chatbot-trigger-bubble:hover .trigger-tooltip-txt {
  opacity: 1;
  transform: translateX(0);
}

/* RTL Adjustments for Trigger Bubble */
body.rtl-active .chatbot-trigger-bubble {
  right: auto;
  left: 30px;
}
body.rtl-active .chatbot-trigger-bubble .trigger-tooltip-txt {
  right: auto;
  left: 75px;
  transform: translateX(-15px);
}
body.rtl-active .chatbot-trigger-bubble:hover .trigger-tooltip-txt {
  transform: translateX(0);
}

/* 2. Chat Window Container */
.chatbot-window-container {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: 380px;
  height: 520px;
  border-radius: 16px;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chatbot-window-container.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

body.rtl-active .chatbot-window-container {
  right: auto;
  left: 30px;
}

/* Light Theme support override */
body.light-theme .chatbot-window-container {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

body.light-theme .chatbot-trigger-bubble {
  box-shadow: 0 8px 32px rgba(169, 50, 38, 0.22);
}

body.light-theme .chatbot-trigger-bubble:hover {
  box-shadow: 0 12px 36px rgba(169, 50, 38, 0.35);
}

/* 3. Chat Header */
.chatbot-header {
  padding: 16px 20px;
  background: rgba(25, 25, 25, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.light-theme .chatbot-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.header-avatar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar-active {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
}

.header-avatar-group h5 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

body.light-theme .header-avatar-group h5 {
  color: #121212;
}

.header-avatar-group span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  color: #888888;
  display: block;
}

.btn-close-chatbot {
  background: none;
  border: none;
  color: #888888;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -10px;
  margin-right: -10px;
}

.btn-close-chatbot:hover {
  color: #ffffff;
}

body.light-theme .btn-close-chatbot:hover {
  color: #121212;
}

/* 4. Messages Body */
.chatbot-messages-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Hide scrollbar but keep functionality */
.chatbot-messages-body::-webkit-scrollbar {
  width: 4px;
}
.chatbot-messages-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Chat bubble basics */
.chat-bubble-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 85%;
  animation: fadeInBubble 0.3s ease forwards;
}

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

.chat-bubble-wrapper.assistant {
  align-self: flex-start;
}

.chat-bubble-wrapper.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.chat-bubble-avatar.user-avatar {
  background: #555555;
  font-weight: 600;
}

.chatbot-avatar-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: brightness(0) invert(1); /* Render dark logo artwork as high-contrast white in dark mode */
}

body.light-theme .chatbot-avatar-img {
  filter: none; /* Show original dark logo on light background */
}

.chat-bubble-text {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.assistant .chat-bubble-text {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top-left-radius: 0;
}

body.light-theme .assistant .chat-bubble-text {
  background: rgba(0, 0, 0, 0.03);
  color: #333333;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.user .chat-bubble-text {
  background: var(--accent-primary, #ff5a1f);
  color: #ffffff;
  border-top-right-radius: 0;
  box-shadow: 0 4px 12px rgba(255, 90, 31, 0.15);
}

body.light-theme .user .chat-bubble-text {
  box-shadow: 0 4px 12px rgba(169, 50, 38, 0.15);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #888888;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

/* 5. Quick Options Buttons container */
.chatbot-options-container {
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(18, 18, 18, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

body.light-theme .chatbot-options-container {
  background: var(--bg-base);
  border-top: 1px solid var(--border-color);
}

.btn-chatbot-option {
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chatbot-option:hover {
  background: var(--accent-primary, #ff5a1f);
  border-color: var(--accent-primary, #ff5a1f);
  transform: translateY(-2px);
}

body.light-theme .btn-chatbot-option {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

body.light-theme .btn-chatbot-option:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* 6. Dynamic Recommendation Cards in Chat */
.chatbot-cards-scroller {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  width: 100%;
}

.chatbot-product-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease;
}

.chatbot-product-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .chatbot-product-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chatbot-card-img {
  width: 65px;
  height: 65px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222222;
}

.chatbot-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chatbot-card-info h6 {
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  margin: 0 0 2px 0;
  color: #ffffff;
}

body.light-theme .chatbot-card-info h6 {
  color: #111111;
}

.chatbot-card-info p {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  color: #aaaaaa;
  margin: 0 0 6px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.light-theme .chatbot-card-info p {
  color: #666666;
}

.chatbot-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-card-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent-primary, #ff5a1f);
}

.btn-chatbot-add-to-cart {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-primary, #ff5a1f);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-chatbot-add-to-cart:hover {
  background: var(--accent-primary-hover, #ff7a47);
}

.btn-chatbot-add-to-cart.added {
  background: #27ae60;
}

/* 7. Input Footer */
.chatbot-input-footer {
  padding: 12px 20px;
  background: rgba(25, 25, 25, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

body.light-theme .chatbot-input-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

.chatbot-input-footer input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 10px 16px;
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.chatbot-input-footer input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary, #ff5a1f);
}

body.light-theme .chatbot-input-footer input {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #121212;
}

body.light-theme .chatbot-input-footer input:focus {
  border-color: var(--accent-primary);
}

.btn-send-chat {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary, #ff5a1f);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.btn-send-chat:hover {
  background: var(--accent-primary-hover, #ff7a47);
}

/* Disabled input state when choosing buttons */
.chatbot-input-footer.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* 8. Mobile Responsiveness */
@media (max-width: 480px) {
  .chatbot-window-container {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    z-index: 1000;
  }
  
  body.rtl-active .chatbot-window-container {
    left: 0;
    right: 0;
  }
  
  .chatbot-trigger-bubble {
    bottom: 20px;
    right: 20px;
  }
  
  body.rtl-active .chatbot-trigger-bubble {
    left: 20px;
    right: auto;
  }
}
