/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color System */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  
  --secondary-50: #f0fdfa;
  --secondary-100: #ccfbf1;
  --secondary-500: #14b8a6;
  --secondary-600: #0d9488;
  --secondary-700: #0f766e;
  
  --success-500: #10b981;
  --warning-500: #f59e0b;
  --error-500: #ef4444;
  
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  
  /* Spacing System */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;


  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --error-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-glass: rgba(255, 255, 255, 0.1);
  
  --text-primary: #ffffff;
  --text-secondary: #b8b8d1;
  --text-muted: #8b8ba7;
  
  --border-glass: rgba(255, 255, 255, 0.2);
  --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
  
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--neutral-800);
  background: var(--neutral-50);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Navigation */
.navbar {
  background: white;
  border-bottom: 1px solid var(--neutral-200);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--primary-600);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-name {
  color: var(--neutral-800);
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.nav-link {
  color: var(--neutral-600);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.nav-link:hover {
  color: var(--primary-600);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.user-name {
  color: var(--neutral-700);
  font-weight: 500;
}

.logout-btn {
  background: var(--error-500);
  color: white;
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.logout-btn:hover {
  background: #dc2626;
}

/* Page System */
.page {
  /* display: none; */
  min-height: calc(100vh - 80px);
}

.page.active {
  display: block;
}

/* Banner */
.banner {
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 50%, var(--secondary-700) 100%);
  color: white;
  padding: var(--space-20) 0;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="6" cy="6" r="6"/></g></g></svg>');
  pointer-events: none;
}

.banner .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.banner-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  line-height: 1.2;
}

.banner-content {
  flex: 1;
  max-width: 600px;
}

.banner-title {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  line-height: 1.1;
}

.banner-subtitle {
  font-size: 1.5rem;
  opacity: 0.9;
  margin-bottom: var(--space-8);
  line-height: 1.5;
}

.banner-buttons {
  display: flex;
  gap: var(--space-4);
}

.banner-icon {
  opacity: 0.8;
  color: var(--primary-100);
}

/* Features Section */
.features {
  padding: var(--space-20) 0;
  background: white;
}

.drag-drop-area {
  border: 2px dashed var(--neutral-300);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.drag-drop-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--secondary-50) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.drag-drop-area:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.drag-drop-area:hover::before {
  opacity: 1;
}

.drag-drop-area.drag-over {
  border-color: var(--primary-600);
  background: var(--primary-50);
  box-shadow: var(--shadow-xl);
}

.drag-drop-content {
  position: relative;
  z-index: 1;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
}

.feature-card {
  text-align: center;
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--neutral-50);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.upload-icon {
  color: var(--primary-600);
  margin-bottom: var(--space-4);
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--neutral-800);
}

.feature-card p {
  color: var(--neutral-600);
  line-height: 1.6;
}

.supported-formats {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.format-tag {
  background: var(--primary-100);
  color: var(--primary-700);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}

.file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  top: 0;
  left: 0;
}

/* Demo Section */
.demo-section {
  margin-bottom: var(--space-16);
}

.demo-container {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.demo-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-6);
  padding: var(--space-8) var(--space-8) 0;
}

.highlight-box {
  background: var(--neutral-900);
  color: var(--neutral-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 var(--space-8) var(--space-8);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-800);
  border-bottom: 1px solid var(--neutral-700);
}

.code-tabs {
  display: flex;
  gap: var(--space-4);
}

.tab {
  color: var(--neutral-400);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tab.active {
  color: var(--primary-500); /* Using primary-500 for active tab */
}

.tab:hover {
  color: var(--neutral-200);
}

.code-actions {
  display: flex;
  gap: var(--space-2);
}

.code-action {
  background: none;
  border: 1px solid var(--neutral-600);
  color: var(--neutral-300);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-action:hover {
  background: var(--neutral-700);
  color: var(--neutral-100);
}

.code-content {
  padding: var(--space-6);
  overflow-x: auto;
}

.demo-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  text-wrap:wrap;
}

.demo-text .key {
  color: #8dd3c7;
}

.demo-text .string {
  color: #ffd92f;
}

.demo-text .number {
  color: #fb8072;
}

.demo-text .boolean {
  color: #bebada;
}

/* Download Section */
.download-section {
  text-align: center;
  background: white;
  padding: var(--space-12);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.download-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-4);
}

.download-description {
  color: var(--neutral-600);
  font-size: 1.125rem;
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.download-btn {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%); /* Use shades of red */
  color: white;
  border: none;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-6);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%); /* Use darker shades of red */
}

.download-btn:active {
  transform: translateY(0);
}

.download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.download-btn:disabled:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

.download-options {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.option-btn {
  background: var(--neutral-100);
  color: var(--neutral-700);
  border: 1px solid var(--neutral-200);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Authentication Pages */
.auth-container {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) 0;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--secondary-50) 100%);
}

.auth-card {
  background: white;
  padding: var(--space-12);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-2);
}

.auth-header p {
  color: var(--neutral-600);
  font-size: 1.125rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-weight: 600;
  color: var(--neutral-700);
}

.form-group input {
  padding: var(--space-4);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.password-input {
  position: relative;
}

.password-toggle {
  position: relative;
  /* right: var(--space-3); */
  right: 0;
  left: 90%;
  top: 0%;
  transform: translateY(-0%);
  background: none;
  border: none;
  color: var(--neutral-400);
  cursor: pointer;
  padding: var(--space-1);
}

.password-toggle:hover {
  color: var(--neutral-600);
}

.error-message {
  color: var(--error-500);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-options {
  display: flex;
  justify-content: flex-end;
  margin-top: -var(--space-2);
}

.forgot-password {
  color: var(--primary-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
}

.general-error {
  color: var(--error-500);
  text-align: center;
  font-weight: 500;
  margin-top: var(--space-4);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--neutral-200);
}

.auth-footer a {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  padding: var(--space-4) var(--space-6);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all 0.2s ease;
  text-decoration: none;
  justify-content: center;
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--neutral-100);
  color: var(--neutral-700);
  border: 2px solid var(--neutral-200);
}

.btn-secondary:hover {
  background: var(--neutral-200);
  border-color: var(--neutral-300);
}

.btn-full {
  width: 100%;
}

/* Upload Page */
.upload-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-8);
}

.upload-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.upload-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-3);
}

.upload-header p {
  font-size: 1.25rem;
  color: var(--neutral-600);
}

/* Upload Section */
.upload-section {
  margin-bottom: var(--space-16);
}

.drag-drop-area {
  border: 2px dashed var(--neutral-300);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* File History List */
.file-history-list {
  list-style: none;
  padding: 0;
  margin-top: var(--space-4);
  max-height: 400px; /* Limit height for scrolling */
  overflow-y: auto;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  position: relative; /* Needed for absolute positioning of loader */
}

.file-history-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.file-history-item:last-child {
  border-bottom: none;
}

.file-history-item:hover {
  background-color: var(--primary-50);
}

.file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.file-name {
  font-weight: 600;
  /* color: var(--primary-50); */
  font-size: 0.95rem;
}

.file-date {
  font-size: 0.8rem;
  color: var(--neutral-500);
}

.file-details {
  font-size: 0.875rem;
  color: var(--neutral-700);
}

.ai-response-preview {
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  margin-top: var(--space-2);
  color: var(--neutral-600);
}

.history-download-options {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.no-history {
  padding: var(--space-4);
  text-align: center;
  color: var(--neutral-500);
  font-style: italic;
}


.drag-drop-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--secondary-50) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.drag-drop-area:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.drag-drop-area:hover::before {
  opacity: 1;
}

.drag-drop-area.drag-over {
  border-color: var(--primary-600);
  background: var(--primary-50);
  box-shadow: var(--shadow-xl);
}

.drag-drop-content {
  position: relative;
  z-index: 1;
}

.upload-icon {
  color: var(--primary-500);
  margin-bottom: var(--space-4);
}

.upload-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: var(--space-2);
}

.upload-description {
  color: var(--neutral-600);
  margin-bottom: var(--space-6);
  font-size: 1rem;
}

.supported-formats {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.format-tag {
  background: var(--primary-100);
  color: var(--primary-700);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}

.file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  top: 0;
  left: 0;
}

.textarea-input {
  width: 100%;
  min-height: 200px;
  opacity: 1;
  border: 2px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-size: 1rem;
  font-family: var(--font-family);
  resize: vertical;
  background: white;
  color: var(--neutral-800);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* Demo Section */
.demo-section {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}

.demo-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-6);
  text-align: center;
}

.demo-content {
  display: grid;
  gap: var(--space-8);
}

.demo-preview {
  background: var(--neutral-50);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-header {
  background: var(--neutral-800);
  color: white;
  padding: var(--space-4);
}

.preview-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

.preview-content {
  padding: var(--space-6);
  max-height: 400px;
  overflow-y: auto;
}

.analysis-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--neutral-700);
  white-space: pre-wrap;
  margin: 0;
}

.download-section {
  text-align: center;
  padding: var(--space-6);
  background: var(--neutral-50);
  border-radius: var(--radius-lg);
}

.download-section h4 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-3);
}

.download-description {
  color: var(--neutral-600);
  margin-bottom: var(--space-6);
  font-size: 1.125rem;
}

.download-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  background: var(--neutral-800);
  color: var(--neutral-300);
  padding: var(--space-8) 0;
  text-align: center;
  margin-top: var(--space-20);
}

/* Progress Bar */
.progress-container {
  margin-top: var(--space-4);
}

.progress-bar {
  width: 100%;
  height: 16px;
  background: var(--neutral-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.progress {
  height: 100%;
  background: var(--primary-600);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-text {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  color: var(--neutral-600);
}

/* Admin Panel */
.admin-container {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) 0;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--secondary-50) 100%);
}

.admin-card {
  background: white;
  padding: var(--space-12);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 800px;
}

.admin-card h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-8);
  text-align: center;
}

.admin-section {
  margin-bottom: var(--space-8);
}

.admin-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.form-group label {
  font-weight: 600;
  color: var(--neutral-700);
}

.form-group textarea {
  padding: var(--space-4);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.btn {
  padding: var(--space-4) var(--space-6);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all 0.2s ease;
  text-decoration: none;
  justify-content: center;
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.prompt-display {
  background: var(--neutral-50);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  min-height: 120px;
  white-space: pre-wrap;
  color: var(--neutral-800);
  font-family: var(--font-mono);
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .banner .container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-8);
  }
  
  .banner-title {
    font-size: 2.5rem;
  }
  
  .banner-subtitle {
    font-size: 1.25rem;
  }
  
  .banner-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .nav-links {
    gap: var(--space-4);
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .auth-card {
    margin: var(--space-4);
    padding: var(--space-8);
  }
  
  .upload-container {
    padding: var(--space-4);
  }
  
  .drag-drop-area {
    padding: var(--space-8);
  }
  
  .download-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .results-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .banner-title {
    font-size: 2rem;
  }
  
  .banner-subtitle {
    font-size: 1.125rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .auth-header h2 {
    font-size: 1.5rem;
  }
  
  .upload-header h2 {
    font-size: 2rem;
  }
  
  .results-title {
    font-size: 1.5rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading .upload-icon svg {
  animation: spin 2s linear infinite;
}

/* Notification Styles */
#notification-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 350px;
}

.notification {
  background-color: white;
  color: var(--neutral-800);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  opacity: 0;
  transform: translateX(100%);
  animation: slideIn 0.3s forwards, fadeOut 0.5s forwards var(--notification-duration, 3s);
}

.notification.success {
  border-left: 5px solid var(--success-500);
}

.notification.error {
  border-left: 5px solid var(--error-500);
}

.notification.info {
  border-left: 5px solid var(--primary-500);
}

.notification-icon {
  flex-shrink: 0;
}

.notification-icon svg {
  width: 24px;
  height: 24px;
}

.notification-content {
  flex-grow: 1;
}

.notification-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.notification-message {
  font-size: 0.9rem;
  color: var(--neutral-600);
}

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

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

/* Spinner for buttons */
.spinner {
  animation: rotate 2s linear infinite;
  width: 20px;
  height: 20px;
}

.spinner .path {
  stroke: currentColor;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.btn svg, .download-btn svg {
    vertical-align: middle;
}

#historyLoader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-8);
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
    border-radius: var(--radius-md);
    margin-top: var(--space-4); /* Add some space above the loader */
    min-height: 100px; /* Ensure it has some height even if content is empty */
    z-index: 10; /* Ensure it's above other content */
    position: absolute; /* Position absolutely within the file-history-list */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure the spinner itself is visible */
.spinner {
  animation: rotate 2s linear infinite;
  width: 40px; /* Increased size for better visibility */
  height: 40px;
  color: var(--primary-500); /* Explicitly set color for the spinner */
}

.spinner .path {
  stroke: currentColor; /* Use currentColor to inherit from .spinner */
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
  stroke-width: 5px; /* Ensure the stroke is visible */
}


#profileSection{
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
}


.file-info2 {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #0000009e;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  animation: slideInUp 0.4s ease-out;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .selected-file {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

.file-icon {
  font-size: 2.5rem;
  animation: bounce 0.6s ease-out;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 600;
  /* color: var(--text-primary); */
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.file-size {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

.remove-file {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 50%;
  color: #ff6b6b;
  transition: var(--transition);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-file:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.5);
  transform: scale(1.1);
}

.analyze-btn {
  width: 100%;
  padding: 1.25rem 2rem;
  margin-top: 2rem;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analyze-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.analyze-btn:hover::before {
  left: 100%;
}

.analyze-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.analyze-btn:disabled {
  background: linear-gradient(135deg, #4a4a5a 0%, #6a6a7a 100%);
  cursor: not-allowed;
  transform: none;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  margin-right: 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.results-section {
  background: #100f0f33;
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-primary);
  margin-bottom: 3rem;
  animation: slideInUp 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.results-section::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius-lg);
  z-index: -1;
  opacity: 0.1;
}

.analysis-result {
  margin-bottom: 3rem;
  text-align: center;
}

.analysis-result h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.result-badge {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  animation: badgeGlow 0.8s ease-out;
}

@keyframes badgeGlow {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.result-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.result-badge:hover::before {
  left: 100%;
}

.result-badge.needs-review {
  background: var(--warning-gradient);
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.result-badge.approved {
  background: var(--success-gradient);
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.result-badge.rejected {
  background: var(--error-gradient);
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

.pdf-viewer {
  margin-top: 2rem;
}

.pdf-viewer h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.01em;
}

.pdf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  flex-wrap: wrap;
}

.pdf-controls button {
  padding: 0.75rem 1.5rem;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.pdf-controls button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.4s;
}

.pdf-controls button:hover::before {
  left: 100%;
}

.pdf-controls button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pdf-controls button:disabled {
  background: linear-gradient(135deg, #4a4a5a 0%, #6a6a7a 100%);
  cursor: not-allowed;
  transform: none;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.zoom-controls button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50%;
}

#jsonDisplay{
  overflow: auto;
}

.json-section{
  background: #ffffffba;
  padding: 10px;
  border-radius: 15px;
}