/* Custom styles for TaxiWeb LLM Services */

:root {
  --primary-color: #2563eb;
  --primary-foreground: #ffffff;
  --secondary-color: #64748b;
  --muted-color: #f1f5f9;
  --muted-foreground: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --border-color: #e2e8f0;
  --border-radius: 0.5rem;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

/* Navigation styles */
.navbar {
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border-color);
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 500;
}

/* Section management */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* Card enhancements */
.card {
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-content {
  padding: 1.5rem;
}

/* Stats cards */
.stats-card {
  background: linear-gradient(135deg, var(--primary-color), #3b82f6);
  color: white;
}

/* Project cards */
.project-card {
  border-left: 4px solid var(--primary-color);
}

.project-card.status-draft {
  border-left-color: var(--secondary-color);
}

.project-card.status-active {
  border-left-color: var(--primary-color);
}

.project-card.status-completed {
  border-left-color: var(--success-color);
}

.project-card.status-archived {
  border-left-color: var(--muted-foreground);
}

/* Product cards */
.product-card {
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.product-card:hover {
  border-color: var(--primary-color);
}

/* UTP items */
.utp-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: white;
  margin-bottom: 0.5rem;
}

.utp-item.priority-1 {
  border-left: 4px solid var(--error-color);
}

.utp-item.priority-2 {
  border-left: 4px solid var(--warning-color);
}

.utp-item.priority-3 {
  border-left: 4px solid var(--success-color);
}

/* Text items */
.text-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  background: white;
  margin-bottom: 1rem;
}

.text-item.status-draft {
  border-left: 4px solid var(--secondary-color);
}

.text-item.status-review {
  border-left: 4px solid var(--warning-color);
}

.text-item.status-approved {
  border-left: 4px solid var(--success-color);
}

.text-item.status-rejected {
  border-left: 4px solid var(--error-color);
}

/* Modal enhancements */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  width: 500px;
}

.modal-lg .modal-content {
  width: 800px;
}

.modal-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--error-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Generation steps */
.generation-step {
  display: none;
}

.generation-step.active {
  display: block;
}

/* Progress bars */
.progress {
  width: 100%;
  height: 0.5rem;
  background-color: var(--muted-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

/* Range inputs */
.range {
  width: 100%;
  height: 0.5rem;
  border-radius: var(--border-radius);
  background: var(--muted-color);
  outline: none;
  -webkit-appearance: none;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.range::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.loading-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid var(--muted-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  color: white;
  font-weight: 500;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background-color: var(--success-color);
}

.toast.error {
  background-color: var(--error-color);
}

.toast.warning {
  background-color: var(--warning-color);
}

.toast.info {
  background-color: var(--primary-color);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: var(--muted-color);
  color: var(--muted-foreground);
}

.badge.badge-sm {
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
}

.badge.badge-primary {
  background-color: var(--primary-color);
  color: var(--primary-foreground);
}

.badge.badge-success {
  background-color: var(--success-color);
  color: white;
}

.badge.badge-warning {
  background-color: var(--warning-color);
  color: white;
}

.badge.badge-error {
  background-color: var(--error-color);
  color: white;
}

/* Status indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-indicator.draft {
  background-color: #f1f5f9;
  color: #64748b;
}

.status-indicator.active {
  background-color: #dbeafe;
  color: #2563eb;
}

.status-indicator.completed {
  background-color: #d1fae5;
  color: #059669;
}

.status-indicator.archived {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* Character counter */
.character-counter {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: right;
}

.character-counter.warning {
  color: var(--warning-color);
}

.character-counter.error {
  color: var(--error-color);
}

/* Dropdown enhancements */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  margin-top: 0.25rem;
}

.dropdown.active .dropdown-content {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #1e293b;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--muted-color);
}

.dropdown-divider {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid var(--border-color);
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.pagination button {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--muted-foreground);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background-color: var(--muted-color);
}

.pagination button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 768px) {
  .modal-content {
    width: 95vw;
    margin: 1rem;
  }
  
  .modal-lg .modal-content {
    width: 95vw;
  }
  
  .toast-container {
    left: 1rem;
    right: 1rem;
  }
  
  .toast {
    max-width: none;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  
  .flex-wrap > * {
    width: 100%;
  }
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.text-muted-foreground { color: var(--muted-foreground); }
.text-green-600 { color: #059669; }
.text-red-600 { color: #dc2626; }
.text-blue-600 { color: #2563eb; }

.bg-muted { background-color: var(--muted-color); }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.w-full { width: 100%; }
.h-16 { height: 4rem; }

.max-h-40 { max-height: 10rem; }
.overflow-y-auto { overflow-y: auto; }

.hidden { display: none; }
.block { display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.mx-auto { margin-left: auto; margin-right: auto; }

.rounded-lg { border-radius: 0.5rem; }

@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}