/* AI Chat Widget Styles */
.ai-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: inherit;
}

.ai-chat-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-blue));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 0 rgba(255,43,74,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: aiPulse 2s infinite;
}

@keyframes aiPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 0 rgba(255,43,74,0.7);
  }
  50% {
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 12px rgba(255,43,74,0);
  }
}

.ai-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

.ai-chat-toggle.active {
  transform: scale(0.9);
}

.ai-pulse {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(74,222,128,0.8);
}

.ai-chat-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-soft);
  box-shadow: 0 24px 60px rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.ai-chat-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 60%);
}

.ai-chat-header-info h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.ai-chat-header-info p {
  font-size: 0.75rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ai-chat-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(10,10,18,0.9);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

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

.ai-chat-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.ai-quick-btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(10,10,18,0.6);
  color: var(--text-main);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.ai-quick-btn:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
}

.ai-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: messageSlideIn 0.3s ease;
}

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

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

.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ai-user .ai-avatar {
  background: rgba(255,255,255,0.1);
}

.ai-message-content {
  flex: 1;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.ai-user .ai-message-content {
  background: linear-gradient(135deg, rgba(255,43,74,0.2), rgba(59,180,255,0.2));
  border-color: rgba(255,255,255,0.15);
}

.ai-message-content p {
  margin-bottom: 8px;
}

.ai-message-content p:last-child {
  margin-bottom: 0;
}

.ai-message-content ul,
.ai-message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.ai-message-content li {
  margin-bottom: 6px;
}

.ai-message-content strong {
  color: var(--accent-gold);
}

.ai-typing {
  opacity: 0.7;
}

.ai-typing .ai-message-content {
  display: flex;
  gap: 6px;
  padding: 16px;
}

.ai-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: aiTypingDot 1.4s infinite;
}

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

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

@keyframes aiTypingDot {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

.ai-chat-input-form {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border-soft);
}

.ai-chat-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(5,5,9,0.96);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.ai-chat-input:focus {
  border-color: var(--accent-blue);
}

.ai-chat-send {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-blue));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.ai-chat-send:active {
  transform: translateY(0);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .ai-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .ai-chat-toggle {
    width: 56px;
    height: 56px;
  }

  .ai-chat-panel {
    bottom: 72px;
    right: 0;
    left: 16px;
    width: auto;
    height: 500px;
  }

  .ai-chat-quick-actions {
    grid-template-columns: 1fr;
  }
}
