/* 🤖 Portfolio AI Assistant */
.ai-assistant-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  z-index: 9998;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-assistant-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.ai-assistant-fab.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ai-assistant-modal {
  position: fixed;
  bottom: 100px;
  right: 2rem;
  width: 400px;
  max-height: 600px;
  background: #0f1419;
  border: 1px solid #30363d;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ai-assistant-modal.open {
  display: flex;
  animation: slideUp 0.3s ease;
}

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

.ai-assistant-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(163, 113, 247, 0.1));
  border-bottom: 1px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ai-assistant-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #e6edf3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-assistant-close {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.ai-assistant-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e6edf3;
}

.ai-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-message {
  display: flex;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.ai-message.user {
  justify-content: flex-end;
}

.ai-message-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-message.user .ai-message-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.ai-message.assistant .ai-message-icon {
  background: #161b22;
  border: 2px solid #30363d;
  color: #58a6ff;
}

.ai-message-content {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.9rem;
}

.ai-message.user .ai-message-content {
  background: #667eea;
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message.assistant .ai-message-content {
  background: #161b22;
  color: #e6edf3;
  border: 1px solid #30363d;
  border-bottom-left-radius: 4px;
}

.ai-message-content a {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: rgba(88, 166, 255, 0.1);
  border-radius: 6px;
  margin: 0.2rem 0;
  transition: all 0.2s;
}

.ai-message-content ul {
  margin: 0.5rem 0;
  padding-left: 0;
  list-style: none;
}

.ai-message-content li {
  margin-left: 1rem;
  position: relative;
  padding-left: 0.5rem;
}

.ai-message-content li::before {
  content: '•';
  position: absolute;
  left: -0.8rem;
  color: #58a6ff;
}

.ai-message-content strong {
  font-weight: 600;
  color: #58a6ff;
}

.ai-message-content em {
  font-style: italic;
  opacity: 0.9;
}

.ai-message-content h2,
.ai-message-content h3,
.ai-message-content h4 {
  margin: 0.5rem 0;
  font-weight: 600;
}

.ai-assistant-input-container {
  padding: 1rem;
  border-top: 1px solid #30363d;
  display: flex;
  gap: 0.5rem;
}

.ai-assistant-input {
  flex: 1;
  padding: 0.75rem;
  background: #0a0e1a;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #e6edf3;
  font-size: 0.9rem;
  resize: none;
  max-height: 100px;
  font-family: inherit;
}

.ai-assistant-input:focus {
  outline: none;
  border-color: #58a6ff;
}

.ai-assistant-send {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-assistant-send:hover {
  transform: scale(1.05);
}

.ai-assistant-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-typing {
  display: flex;
  gap: 4px;
  padding: 0.5rem;
}

.ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58a6ff;
  animation: typing 1.4s infinite;
}

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

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

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

@media (max-width: 768px) {
  .ai-assistant-modal {
    right: 1rem;
    left: 1rem;
    width: auto;
    max-height: 500px;
  }
  
  .ai-assistant-fab {
    bottom: 1rem;
    right: 1rem;
  }
}
