/* ═══════════════════════════════════════════════════════════
   assistant.css — Smart Assistant (FAQ Chatbot)
   ═══════════════════════════════════════════════════════════ */

/* ─── Bubble button ─── */
#assistantBubble {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1500;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 173, 181, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#assistantBubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 173, 181, 0.55);
}
#assistantBubble:active {
  transform: scale(0.95);
}

/* ─── Chat container ─── */
#assistantChat {
  position: fixed;
  bottom: 90px;
  left: 20px;
  z-index: 1499;
  width: 340px;
  max-height: 500px;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.45);
  backdrop-filter: blur(12px);
  overflow: hidden;
  font-size: 14px;
}
#assistantChat.open { display: flex; }

/* ─── Header ─── */
.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--surface);
  backdrop-filter: blur(4px);
}
.assistant-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.assistant-header h3 span { font-size: 18px; }
.assistant-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
}
.assistant-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ─── Messages area ─── */
.assistant-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 340px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.assistant-msgs::-webkit-scrollbar { width: 4px; }
.assistant-msgs::-webkit-scrollbar-track { background: transparent; }
.assistant-msgs::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 4px; }

/* ─── Messages ─── */
.assistant-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.assistant-msg.bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--accent);
}
.assistant-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.assistant-msg a {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

/* ─── Quick replies ─── */
.assistant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  max-height: 90px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.assistant-quick::-webkit-scrollbar { width: 3px; }
.assistant-quick::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }
.assistant-quick-btn {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.assistant-quick-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Input area ─── */
.assistant-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.assistant-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.assistant-input:focus { border-color: var(--accent); }
.assistant-input::placeholder { color: var(--text-dim); opacity: 0.6; }

.assistant-send {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.assistant-send:hover { background: var(--accent2); transform: scale(1.05); }
.assistant-send:active { transform: scale(0.95); }



/* ─── Typing indicator ─── */
.assistant-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
  background: var(--surface);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--accent);
}
.assistant-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typingDot 1.2s infinite;
}
.assistant-typing span:nth-child(2) { animation-delay: 0.2s; }
.assistant-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* ─── RTL ─── */
[dir="rtl"] #assistantBubble { left: auto; right: 20px; }
[dir="rtl"] #assistantChat { left: auto; right: 20px; }
[dir="rtl"] .assistant-msg.bot {
  border-left: none;
  border-right: 3px solid var(--accent);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}
[dir="rtl"] .assistant-msg.user {
  border-bottom-right-radius: 14px;
  border-bottom-left-radius: 4px;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  #assistantChat {
    width: calc(100% - 32px) !important;
    left: 16px !important;
    right: 16px !important;
    bottom: 80px;
    max-height: 60vh !important;
  }
  #assistantBubble {
    bottom: 16px;
    left: 16px;
  }
  [dir="rtl"] #assistantBubble { left: auto; right: 16px; }

}
