/* Enhanced Chatbox Component Styles */
.chatbox-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
.chatbox-toggle {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.chatbox-toggle:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.chatbox-toggle::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #10b981;
  border-radius: 50%;
  top: 8px;
  right: 8px;
  border: 2px solid white;
}

.chatbox-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 550px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  backdrop-filter: blur(10px);
}
.chatbox-header {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.1);
}

.chatbox-title {
  font-weight: 600;
  font-size: 16px;
}

.chatbox-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}

.chatbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chatbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafafa;
}

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

.chatbox-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chatbox-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.chatbox-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
.message {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.user {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.message.assistant {
  background: white;
  color: #374151;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced Markdown Styling */
.message.assistant h1, 
.message.assistant h2, 
.message.assistant h3 {
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
  color: #111827;
}

.message.assistant h1 {
  font-size: 1.4em;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.3em;
}

.message.assistant h2 {
  font-size: 1.2em;
}

.message.assistant h3 {
  font-size: 1.1em;
}

.message.assistant p {
  margin-bottom: 0.8em;
}

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

.message.assistant strong {
  font-weight: 600;
  color: #111827;
}

.message.assistant em {
  font-style: italic;
  color: #4b5563;
}

.message.assistant ul {
  margin: 0.5em 0 1em 0;
  padding-left: 1.5em;
}

.message.assistant li {
  margin-bottom: 0.3em;
}

.message.assistant li:last-child {
  margin-bottom: 0;
}
.message.typing {
  background: white;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.typing-indicator {
  display: flex;
  gap: 3px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #6b7280;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

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

.chatbox-input-container {
  padding: 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
}

.chatbox-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.chatbox-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chatbox-send {
  padding: 12px 16px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbox-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.chatbox-send:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chatbox-welcome {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  padding: 0;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.quick-action-btn {
  background: white;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quick-action-btn:hover {
  background: #f9fafb;
  border-color: #4f46e5;
  color: #4f46e5;
}

/* Responsive */
@media (max-width: 768px) {
  .chatbox-container {
    bottom: 15px;
    right: 15px;
  }
  
  .chatbox-window {
    width: calc(100vw - 30px);
    height: calc(100vh - 120px);
    bottom: 80px;
    right: 0;
  }
  
  .chatbox-toggle {
    width: 50px;
    height: 50px;
  }
}

/* Animation for window opening */
.chatbox-window {
  animation: slideUp 0.3s ease-out;
}

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