/* MJB AI Document Formatter - Modern High Contrast UI */

:root {
  /* Brand Colors - shared across themes */
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-light: rgba(14, 165, 233, 0.1);
  --primary-glow: rgba(14, 165, 233, 0.3);
  --accent: #8b5cf6;
  --accent-light: rgba(139, 92, 246, 0.1);
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.1);
  --error: #ef4444;
  --error-light: rgba(239, 68, 68, 0.1);

  /* Dark Theme (Default) */
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0f172a;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #334155;
  --border-light: #475569;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--primary-glow);

  /* Border Radius */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Transitions */
  --transition-speed: 0.3s;
}

/* Light Theme Override */
body.light-theme {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.15);
  --primary-light: rgba(14, 165, 233, 0.08);
  --accent-light: rgba(139, 92, 246, 0.08);
  --success-light: rgba(34, 197, 94, 0.08);
  --error-light: rgba(239, 68, 68, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* App Layout */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top left, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    var(--bg-dark);
  transition: background-color var(--transition-speed) ease;
}

/* Light theme background gradient adjustment */
body.light-theme .app {
  background:
    radial-gradient(ellipse at top left, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    var(--bg-dark);
}

.main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  width: 100%;
  position: relative;
}

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.footer strong {
  color: var(--primary);
  font-weight: 600;
}

/* Selected Action Banner */
.selected-action-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.selected-action-banner.hidden {
  display: none;
}

.selected-action-banner .icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selected-action-banner .label {
  font-size: 0.7rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.selected-action-banner .value {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Progress Steps */
.progress-steps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 50px;
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.3s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
  border: 1px solid var(--border);
}

.step.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  transform: scale(1.05);
}

.step.completed {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.step-number {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
  font-size: 0.7rem;
}

.step.active .step-number,
.step.completed .step-number {
  background: rgba(255, 255, 255, 0.25);
}

.step-label {
  display: none;
  font-weight: 500;
}

@media (min-width: 640px) {
  .step-label {
    display: inline;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideUp 0.4s ease;
  transition: background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
}

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

.card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card-description {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.hidden {
  display: none !important;
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.action-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
  text-align: center;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.action-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.action-card:hover::before {
  transform: scaleX(1);
}

.action-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.action-card.selected::before {
  transform: scaleX(1);
}

.action-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  border: 1px solid var(--border);
}

.action-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.action-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
  background: var(--bg-input);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.upload-zone.dragover {
  border-style: solid;
  transform: scale(1.02);
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  border: 1px solid var(--border);
}

.upload-text {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.upload-note {
  font-size: 0.8rem;
  color: var(--primary);
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  border-radius: var(--radius-xs);
  display: inline-block;
}

/* File List */
.file-list {
  margin-top: 1.5rem;
}

.file-list h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.files {
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: all 0.2s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
}

.file-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.file-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.file-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.file-size {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.file-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--error-light);
  color: var(--error);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-remove:hover {
  background: var(--error);
  color: white;
  transform: scale(1.1);
}

/* Contact Section */
.contact-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.contact-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.contact-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-fields .form-group {
  margin-bottom: 0;
}

.contact-fields .form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.contact-fields .form-group .required {
  color: var(--error);
}

.contact-fields .form-group input,
.contact-fields .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
}

.contact-fields .form-group input:focus,
.contact-fields .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.contact-fields .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.contact-fields .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .contact-fields .form-row {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.button-group {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  min-width: 140px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0284c7 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5), var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.3s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  min-width: auto;
}

.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Collapsible Section */
.collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: var(--bg-input);
  transition: background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease,
              background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
  user-select: none;
  border-bottom: 1px solid transparent;
}

.collapsible-header:hover {
  background: var(--bg-card-hover);
}

.collapsible.expanded .collapsible-header {
  border-bottom-color: var(--border);
}

.collapsible-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.collapsible-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.collapsible-toggle svg {
  transition: transform 0.3s ease;
}

.collapsible.expanded .collapsible-toggle svg {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible.expanded .collapsible-content {
  max-height: 2000px;
}

.collapsible-inner {
  padding: 1rem 1.25rem;
}

/* JSON Editor */
.json-editor-container {
  position: relative;
}

.editor-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.json-editor {
  width: 100%;
  min-height: 300px;
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: #0a0a0f;
  color: #22d3ee;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: background-color var(--transition-speed) ease,
              color var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
}

body.light-theme .json-editor {
  background: #f8f9fa;
  color: #0f4c81;
}

.json-editor:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.json-error {
  padding: 0.75rem 1rem;
  background: var(--error-light);
  color: var(--error);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Data Preview */
.data-preview {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
}

.data-preview h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.data-preview h3 svg {
  color: var(--primary);
}

.preview-content {
  font-size: 0.9rem;
}

.object-list {
  margin: 0;
}

.object-list .field {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.object-list .field:last-child {
  border-bottom: none;
}

.object-list dt {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.object-list dd {
  margin: 0;
  color: var(--text);
}

.array-list {
  list-style: none;
  padding-left: 0;
}

.array-list li {
  padding: 0.5rem 0.75rem;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  color: var(--text);
}

.value {
  color: var(--text);
}

.null, .empty {
  color: var(--text-dim);
  font-style: italic;
}

/* Success State */
.success-content {
  text-align: center;
  padding: 2rem 0;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--success-light);
  border: 1px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  animation: successPop 0.5s ease;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
}

@keyframes successPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-content h2 {
  color: var(--success);
  margin-bottom: 0.5rem;
}

.success-message {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.odoo-record {
  background: var(--success-light);
  border: 1px solid var(--success);
  padding: 1.5rem 2rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.odoo-record .submission-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(34, 197, 94, 0.3);
}

.odoo-record .code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.odoo-record .code-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  letter-spacing: 0.15em;
  color: white;
  background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
}

.odoo-record .submission-details p {
  margin: 0.375rem 0;
  font-size: 0.9rem;
  color: var(--text);
}

.odoo-record .submission-details strong {
  color: var(--success);
}

.success-actions {
  margin-top: 2rem;
  text-align: center;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-content {
  background: var(--bg-card);
  padding: 2.5rem 3.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border: 1px solid var(--border);
  animation: slideUp 0.3s ease;
  transition: background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
}

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

#loadingText {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  white-space: pre-line;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.loading-phase {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loading-progress {
  margin-top: 1rem;
  width: 280px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.loading-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  max-width: 300px;
  word-break: break-word;
  opacity: 0.8;
}

/* Error styling */
.error {
  color: var(--error);
}

/* Error Banner */
.error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  padding: 1rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-banner.hidden {
  display: none;
}

.error-banner-content {
  max-width: 800px;
  margin: 0 auto;
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  border: 1px solid #dc2626;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 10px 40px rgba(220, 38, 38, 0.3);
}

.error-banner-icon {
  flex-shrink: 0;
  color: #fca5a5;
}

.error-banner-text {
  flex: 1;
  color: white;
}

.error-banner-text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.error-banner-text p {
  font-size: 0.9rem;
  color: #fecaca;
  margin: 0;
  line-height: 1.5;
}

.error-banner-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.error-banner-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* App Header */
.app-header {
  text-align: center;
  padding: 2rem 1rem 0;
}

.app-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* File Grouping Toggle */
.file-grouping-toggle {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.toggle-label {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.toggle-buttons {
  display: flex;
  gap: 0.5rem;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.toggle-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.toggle-hint {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
}

/* Individual Results */
.individual-results,
.individual-errors {
  text-align: left;
  margin-bottom: 1rem;
}

.individual-results h3,
.individual-errors h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.individual-results ul,
.individual-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.individual-results li,
.individual-errors li {
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.individual-results li {
  border-left: 3px solid var(--success);
}

.individual-errors li {
  border-left: 3px solid var(--error);
  color: var(--error);
}

.individual-results .code-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: var(--success);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 46px;
  height: 46px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  color: var(--text);
  transition: all 0.3s ease;
}

.theme-toggle:hover svg {
  color: var(--primary);
  transform: rotate(15deg);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: scale(0) rotate(180deg);
}

.theme-toggle .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

body.light-theme .theme-toggle .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

body.light-theme .theme-toggle .icon-moon {
  opacity: 0;
  transform: scale(0) rotate(-180deg);
}

/* Tooltip for theme toggle */
.theme-toggle::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -40px;
  right: 0;
  background: var(--bg-card);
  color: var(--text);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.theme-toggle:hover::before {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
  .main {
    padding: 1.5rem 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .button-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .object-list .field {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .object-list dt {
    font-size: 0.8rem;
  }

  .file-grouping-toggle {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
  }

  .theme-toggle svg {
    width: 20px;
    height: 20px;
  }
}
