/* ============================================
   ADAPTIVE CLOUD BOT STYLES
   ============================================ */

.bot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}

/* Bot Toggle Button */
.bot-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  cursor: pointer;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  text-decoration: none;
  user-select: none;
  min-width: 180px;
}

.bot-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-amber);
}

.bot-toggle.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.bot-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-amber);
  flex-shrink: 0;
}

.bot-text {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

/* Bot Chat Window */
.bot-chat {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 500px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
}

.bot-chat.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Bot Header */
.bot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.bot-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-amber) 0%, #ffd700 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.bot-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.bot-title p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.bot-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 16px;
  line-height: 1;
}

.bot-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Messages Area */
.bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.bot-messages::-webkit-scrollbar {
  width: 6px;
}

.bot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.bot-messages::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

.bot-messages::-webkit-scrollbar-thumb:hover {
  background: var(--accent-amber);
}

/* Message Styles */
.bot-message, .user-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

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

.bot-message-avatar, .user-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.bot-message-avatar {
  background: linear-gradient(135deg, var(--accent-amber) 0%, #ffd700 100%);
  box-shadow: var(--shadow-sm);
}

.user-message-avatar {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.bot-message-content, .user-message-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 260px;
  word-wrap: break-word;
}

.bot-message-content {
  color: var(--text-primary);
}

.user-message-content {
  background: linear-gradient(135deg, var(--accent-amber) 0%, #ffd700 100%);
  color: #000;
  border-color: var(--accent-amber);
}

/* Typing Indicator */
.bot-message.typing .bot-message-content {
  padding: 16px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Input Area */
.bot-input-container {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--glass-border);
  background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(255, 255, 255, 0.02) 100%);
}

#bot-input {
  flex: 1;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

#bot-input:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.1);
}

#bot-input::placeholder {
  color: var(--text-secondary);
}

#bot-send {
  background: linear-gradient(135deg, var(--accent-amber) 0%, #ffd700 100%);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#bot-send:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#bot-send:active {
  transform: translateY(0);
}

/* Suggestions */
.bot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.bot-suggestion {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-suggestion:hover {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--accent-amber);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .bot-container {
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .bot-container {
    bottom: 16px;
    right: 16px;
    left: auto;
  }
  
  .bot-chat {
    width: 100%;
    height: 70vh;
    max-height: 500px;
    position: fixed;
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  
  .bot-toggle {
    min-width: auto;
    justify-content: center;
  }
  
  .bot-text {
    display: none;
  }
  
  .bot-suggestion {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bot-toggle, .bot-chat, .bot-message-content, .user-message-content, #bot-input {
    border-width: 2px;
  }
  
  .bot-suggestion {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .bot-toggle, .bot-chat, .bot-close, #bot-send, .bot-suggestion {
    transition: none;
  }
  
  .typing-dots span {
    animation: none;
  }
  
  .bot-toggle:hover, #bot-send:hover, .bot-suggestion:hover {
    transform: none;
  }
}
