/*========= AI Chat Bot =========*/

.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: var(--font-main);
}

/* Chat Toggle Button */
.chat-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--accent, #667eea) 0%, var(--accent-2, #764ba2) 100%);
  color: var(--bg, white);
  padding: 14px 18px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  bottom: 20px;
  right: 20px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.chat-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-icon i {
  width: 24px;
  height: 24px;
}

.notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #ff4757;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse-notification 2s infinite;
}

.chat-preview {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-window.open {
  display: flex;
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, var(--accent, #667eea) 0%, var(--accent-2, #764ba2) 100%);
  color: var(--bg, white);
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar i {
  width: 20px;
  height: 20px;
}

.chat-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.status {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 500;
}

.chat-close {
  position: absolute;
  top: 5px;
  left: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  border-radius: 50px;
  transition: background 0.2s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-close i {
  width: 16px;
  height: 16px;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: messageSlideIn 0.3s ease-out;
}

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

.message-avatar {
  width: 32px;
  height: 32px;
  background-color:var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-p-container{
  display: flex;
  gap: 12px;
}
.bot-message .message-avatar {
  background: linear-gradient(135deg, var(--accent, #667eea) 0%, var(--accent-2, #764ba2) 100%);
  color: var(--bg, white);
}

.user-message {
  flex-direction: row-reverse;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  color: white;
}

.message-content {
  max-width: 250px;
  position: relative;
  overflow-wrap: break-word;
  border-radius: 18px;
  background:linear-gradient(135deg, var(--accent, #667eea) 0%, var(--accent-2, #764ba2) 100%);
}

#welcome-msg{
  padding: 15px;
}

.message-content::webkit-scrollbar {
  width: 6px;
}

.message-content::webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.message-content::webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.message-content p {
  margin: 0;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;

}

.bot-message .message-content p {
  background: #f8fafc;
  color: #334155;
  border-bottom-left-radius: 6px;
}

.user-message .message-content p {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}

.welcome-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.welcome-message p {
  margin: 0 0 12px 0;
  font-size: 15px;
}

.catalog {
  margin-top: 12px;
}

.catalog-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.catalog-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.catalog-list {
  list-style: none;
  padding: 10px 0;
  margin: 10px 0 0 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: none;
  overflow-x: hidden;
  max-height: 150px;
  overflow-y: auto;
}

.catalog-list::-webkit-scrollbar {
  width: 6px;
}

.catalog-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.catalog-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

.catalog-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

.catalog-list li {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.catalog-list li:last-child {
  border-bottom: none;
}

.quick-questions{
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 5px;
}

.quick-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 16px;
  border-radius: 25px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Chat Input */

.chat-input-container{
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap:3px ;
  padding: 1rem 1.2rem;
}
.chat-input-area {
  padding: 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
 width: 100%;
}

#chatInput {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  resize: none;
  min-height: 20px;
  max-height: 100px;
  transition: border-color 0.2s ease;
}

#chatInput:focus {
  border-color: #667eea;
}

#sendBtn {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent, #667eea) 0%, var(--accent-2, #764ba2) 100%);
  border: none;
  border-radius: 50%;
  color: var(--bg, white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.send-btn i {
  width: 16px;
  height: 16px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  justify-content: center;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #667eea;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}



/*Scroll Bar*/
.chat-messages::-webkit-scrollbar {
  width: 10px;

}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  margin-top: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ai-chatbot {
    bottom: 15px;
    right: 15px;
  }

  .chat-window {
    width: calc(100vw - 30px);
    max-width: 350px;
    height: 450px;
    bottom: 70px;
  }

  .chat-toggle {
    padding: 12px 16px;
    font-size: 13px;
  }

  .chat-preview {
    display: none;
  }

  .notification-dot {
    width: 10px;
    height: 10px;
  }
}