/* Global Styles */
:root {
  --primary-color: #4f46e5;
  --secondary-color: #6366f1;
  --text-color: #374151;
  --light-bg: #f9fafb;
  --dark-bg: #1f2937;
  --success-color: #10b981;
  --error-color: #ef4444;
  --border-color: #e5e7eb;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-color);
  line-height: 1.5;
  background-color: var(--light-bg);
  margin: 0;
  padding: 0;
}

/* Upload Zone Styles */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--primary-color);
  background-color: rgba(79, 70, 229, 0.05);
}

.upload-zone.has-file {
  border-color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.05);
}

/* Chat Styles */
.chat-container {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 1rem;
  background-color: white;
}

.message {
  margin-bottom: 1rem;
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  animation: fadeIn 0.3s ease;
  position: relative;
}

.message:hover .edit-button {
  opacity: 1;
}

.edit-button {
  opacity: 0;
  transition: opacity 0.2s ease;
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-message {
  background-color: var(--primary-color);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 0.25rem;
}

.ai-message {
  background-color: #e5e7eb;
  color: var(--text-color);
  margin-right: auto;
  border-bottom-left-radius: 0.25rem;
}

/* Loading Animation */
.loading-dots {
  display: inline-flex;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-color);
  margin: 0 4px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

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

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

/* Button Styles */
.btn {
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* PDF Preview */
.pdf-preview {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem;
  margin-top: 1rem;
}

/* Navigation Styles */
nav a {
  position: relative;
  padding-bottom: 2px;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chat-messages {
    height: 320px;
  }
  
  .message {
    max-width: 90%;
  }
  
  nav {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
  }
  
  nav a {
    font-size: 0.9rem;
  }
}