/* =========================================================
   BAMBS.SHOP — AI Support Chatbot & Logging System Styles
   Bamboo theme integrated with dark glass aesthetics
   ========================================================= */

/* ── Floating Chat Button ───────────────────────────────── */
.ai-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1b5e20, #4caf50);
  border: 2px solid #81c784;
  border-radius: 50px;
  padding: 12px 20px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(76,175,80,0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
}
.ai-chat-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 30px rgba(76,175,80,0.6);
  border-color: #a5d6a7;
}

.ai-launcher-icon {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 2.5s infinite ease-in-out;
}

.ai-online-dot {
  width: 9px;
  height: 9px;
  background: #00e676;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #00e676;
}

/* ── Chat Widget Window ─────────────────────────────────── */
.ai-chat-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 380px;
  height: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  z-index: 1500;
  background: rgba(12, 26, 10, 0.96);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(106, 191, 105, 0.35);
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.65), 0 0 35px rgba(76,175,80,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ── Chat Header ────────────────────────────────────────── */
.ai-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(27,94,32,0.85), rgba(10,22,8,0.95));
  border-bottom: 1px solid rgba(106, 191, 105, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2e7d32, #66bb6a);
  border: 1px solid #a5d6a7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ai-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #e8f5e9;
  letter-spacing: -0.01em;
}

.ai-subtitle {
  font-size: 0.72rem;
  color: #81c784;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-btn-ctrl {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(106,191,105,0.25);
  color: #c5e1a5;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.ai-btn-ctrl:hover {
  background: rgba(106,191,105,0.2);
  color: #fff;
  border-color: #81c784;
}

/* ── Chat Messages Stream ────────────────────────────────── */
.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ai-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeInUp 0.25s ease both;
}

.ai-message.bot {
  align-self: flex-start;
}

.ai-message.user {
  align-self: flex-end;
}

.ai-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.55;
  word-break: break-word;
}

.ai-message.bot .ai-bubble {
  background: rgba(27, 55, 20, 0.75);
  border: 1px solid rgba(106, 191, 105, 0.25);
  color: #e8f5e9;
  border-top-left-radius: 4px;
}

.ai-message.user .ai-bubble {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  color: #fff;
  border: 1px solid #66bb6a;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(46,125,50,0.3);
}

.ai-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}
.ai-message.user .ai-time { text-align: right; }

/* ── Quick Action Suggestion Chips ──────────────────────── */
.ai-quick-chips {
  padding: 8px 14px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(106, 191, 105, 0.15);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.ai-quick-chips::-webkit-scrollbar { display: none; }

.ai-chip {
  background: rgba(106, 191, 105, 0.1);
  border: 1px solid rgba(106, 191, 105, 0.3);
  color: #c5e1a5;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.ai-chip:hover {
  background: rgba(106, 191, 105, 0.25);
  color: #fff;
  border-color: #81c784;
}

/* ── Chat Input ─────────────────────────────────────────── */
.ai-chat-input-bar {
  padding: 12px 16px;
  background: rgba(10, 22, 8, 0.95);
  border-top: 1px solid rgba(106, 191, 105, 0.2);
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(106, 191, 105, 0.25);
  border-radius: 25px;
  padding: 10px 16px;
  color: #e8f5e9;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border 0.2s ease;
}
.ai-input:focus {
  border-color: #81c784;
  box-shadow: 0 0 0 2px rgba(106, 191, 105, 0.15);
}

.ai-btn-send {
  background: linear-gradient(135deg, #388e3c, #4caf50);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(56,142,60,0.3);
}
.ai-btn-send:hover {
  background: linear-gradient(135deg, #43a047, #66bb6a);
  transform: scale(1.06);
}

/* ── Log Modal / Drawer ─────────────────────────────────── */
.ai-log-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(5, 12, 4, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.ai-log-modal.open {
  opacity: 1;
  visibility: visible;
}

.ai-log-box {
  background: #0a1608;
  border: 1px solid #4caf50;
  border-radius: 18px;
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 60px rgba(0,0,0,0.8), 0 0 30px rgba(76,175,80,0.3);
  overflow: hidden;
}

.ai-log-header {
  padding: 18px 24px;
  background: rgba(27,94,32,0.3);
  border-bottom: 1px solid rgba(106,191,105,0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-log-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #a5d6a7;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-log-actions {
  display: flex;
  gap: 10px;
}

.ai-log-table-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  background: #060e05;
}

.ai-log-entry {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(106,191,105,0.1);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.5;
}
.ai-log-entry:hover {
  background: rgba(106,191,105,0.06);
}

.log-time { color: #66bb6a; flex-shrink: 0; width: 85px; }
.log-level {
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  flex-shrink: 0;
  text-transform: uppercase;
}
.log-level.info  { background: rgba(33,150,243,0.15); color: #64b5f6; }
.log-level.chat  { background: rgba(76,175,80,0.15); color: #81c784; }
.log-level.order { background: rgba(255,193,7,0.15); color: #ffd54f; }
.log-level.error { background: rgba(244,67,54,0.15); color: #e57373; }

.log-content { flex: 1; color: #e8f5e9; word-break: break-all; }
.log-meta { color: #81c784; font-size: 0.72rem; }
