/* ========================================
   CHATAI WIDGET STYLES - FONT AWESOME ICONS
   ======================================== */

/* Widget Container */
.chatai-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: Arial, sans-serif;
}

/* Toggle Button */
.chatai-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b00202 0%, #860404 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatai-toggle i {
  font-size: 20px;
  transition: all 0.3s ease;
}

.chatai-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Chat Container */
.chatai-container {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Header */
.chatai-header {
  background: linear-gradient(135deg, #b00202 0%, #860404 100%);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: bold;
  position: relative;
}

.chatai-header .chatai-close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatai-header .chatai-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.chatai-messages {
  height: 350px;
  overflow-y: auto;
  padding: 15px;
  background: #f8f9fa;
  scroll-behavior: smooth;
}

/* Input Container */
.chatai-input-container {
  padding: 18px 20px;
  border-top: 1px solid #eee;
  background: white;
  position: relative;
  border-radius: 0 0 12px 12px;
}

.chatai-input {
  width: 100%;
  padding: 12px 50px 12px 18px;
  border: 2px solid #e1e5e9;
  border-radius: 25px;
  outline: none;
  font-size: 14px;
  font-family: Arial, sans-serif;
  background: #fafbfc;
  color: #333;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  line-height: 1.4;
}

.chatai-input:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.chatai-input::placeholder {
  color: #9ca3af;
  font-style: italic;
  transition: color 0.2s ease;
}

.chatai-input:focus::placeholder {
  color: #d1d5db;
}

.chatai-input:hover:not(:focus) {
  border-color: #c7d2fe;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Send Button */
.chatai-send {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chatai-send:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatai-send:active {
  transform: translateY(-50%) scale(0.95);
}

/* Messages */
.message {
  margin-bottom: 15px;
  max-width: 100%;
  padding: 10px 15px;
  border-radius: 18px;
  word-wrap: break-word;
  line-height: 1.4;
  position: relative;
}

/* User Messages */
.message.user {
  background: #667eea;
  color: white;
  margin-left: auto;
  text-align: right;
}

.message.user:before {
  content: '\f007';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: -12px;
  top: 10px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* AI Messages */
.message.ai {
  background: white;
  color: #333;
  border: 1px solid #e1e5e9;
  margin-right: auto;
}

.message.ai:before {
  content: '\f544';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  left: -12px;
  top: 10px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* New AI Message Highlight */
.message.ai.new-ai-message {
  animation: highlightNewMessage 2s ease-in-out;
  border: 1px solid #667eea;
}

@keyframes highlightNewMessage {
  0% {
    background-color: #f0f4ff;
    border-color: #667eea;
  }
  50% {
    background-color: #e8f2ff;
    border-color: #667eea;
  }
  100% {
    background-color: white;
    border-color: #e1e5e9;
  }
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  padding: 10px 15px;
  color: #666;
  font-style: italic;
  position: relative;
  margin-left: 25px;
}

.typing-indicator:before {
  content: '\f544';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  left: -25px;
  top: 10px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* Suggestion Buttons */
.suggestion-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  margin-left: 25px;
}

.suggestion-btn {
  background: #f1f3f4;
  border: none;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.suggestion-btn:hover {
  background: #e0e4e7;
}

.suggestion-btn:before {
  content: '\f05a';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-right: 5px;
  font-size: 10px;
  color: #667eea;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chatai-container {
    width: 300px;
    height: 450px;
  }

  .chatai-toggle {
    width: 55px;
    height: 55px;
    font-size: 18px;
  }

  .chatai-toggle i {
    font-size: 18px;
  }

  .message.user:before,
  .message.ai:before,
  .typing-indicator:before {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .message.user:before {
    right: -23px;
  }

  .message.ai:before,
  .typing-indicator:before {
    left: -23px;
  }

  .suggestion-buttons {
    margin-left: 23px;
  }
}

/* Animations */
.typing-indicator.show {
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

/* Scrollbar Styling */
.chatai-messages::-webkit-scrollbar {
  width: 6px;
}

.chatai-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chatai-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chatai-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* More Content Indicator */
.chatai-messages::after {
  content: '';
  position: absolute;
  bottom: 85px;
  right: 10px;
  width: 20px;
  height: 20px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 50%;
  display: none;
  pointer-events: none;
}

.chatai-messages.has-more-content::after {
  content: '\f078';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(102, 126, 234, 0.8);
  color: white;
  font-size: 10px;
  animation: bounceDown 1.5s ease-in-out infinite;
}

@keyframes bounceDown {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(-2px);
  }
}
