:root {
  /* Modern Color Palette */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-active: #1e40af;
  --color-secondary: #64748b;
  --color-secondary-hover: #475569;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-info: #0891b2;

  /* Gray Scale */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* Light Theme */
  --bg-color: var(--color-white);
  --bg-secondary: var(--color-gray-50);
  --bg-tertiary: var(--color-gray-100);
  --font-color: var(--color-gray-900);
  --font-color-secondary: var(--color-gray-600);
  --font-color-muted: var(--color-gray-500);
  --border-color: var(--color-gray-200);
  --border-color-hover: var(--color-gray-300);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing */
  --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;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-base: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-base: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --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);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-Index */
  --z-dropdown: 1000;
  --z-modal: 1050;
  --z-tooltip: 1100;
}

[data-theme="dark"] {
  --bg-color: var(--color-gray-900);
  --bg-secondary: var(--color-gray-800);
  --bg-tertiary: var(--color-gray-700);
  --font-color: var(--color-gray-100);
  --font-color-secondary: var(--color-gray-300);
  --font-color-muted: var(--color-gray-400);
  --border-color: var(--color-gray-700);
  --border-color-hover: var(--color-gray-600);
}

[data-theme="dark"] .drop-zone {
  border-color: var(--color-gray-600);
}

[data-theme="dark"] .drop-zone:hover {
  border-color: var(--color-primary);
}

[data-theme="dark"] .drop-zone.drag-over {
  background: rgba(37, 99, 235, 0.15);
}

/* Base Styles */
body {
  font-family: var(--font-family);
  margin: 0;
  padding: var(--space-4);
  color: var(--font-color);
  background-color: var(--bg-color);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  transition: background-color var(--transition-base), color var(--transition-base);
  min-height: 100vh;
}

/* Wrapper */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* Header */
header {
  margin-bottom: var(--space-8);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.branding {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--font-color);
  letter-spacing: -0.02em;
}

.branding span {
  color: var(--color-primary);
  font-weight: 600;
}

.hero {
  text-align: center;
  margin-bottom: var(--space-8);
  /* Hierarchy: Enhanced visual hierarchy */
  padding: var(--space-8) 0;
  background: linear-gradient(135deg, transparent, rgba(37, 99, 235, 0.03), transparent);
  border-radius: var(--radius-2xl);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--font-color);
  margin: 0 0 var(--space-4) 0;
  letter-spacing: -0.025em;
  line-height: var(--line-height-tight);
  /* Hierarchy: Add text shadow for depth */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Movement: Subtle animation */
  animation: fadeInUp 0.8s ease-out;
}

.hero p {
  font-size: var(--font-size-xl);
  color: var(--font-color-secondary);
  margin: 0;
  line-height: var(--line-height-relaxed);
}

/* Icon Button */
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  color: var(--font-color-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.icon-button:hover {
  background-color: var(--bg-secondary);
  color: var(--font-color);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(0);
}

/* Theme Switcher */
#theme-switcher .icon {
  width: 20px;
  height: 20px;
  transition: all var(--transition-base);
}

#sun-icon,
#moon-icon {
  display: none;
}

/* Sections */
section {
  margin-bottom: var(--space-10);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Upload Section */
.upload-section {
  animation-delay: 0s;
}

/* Hide file input completely */
#fileInput {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  visibility: hidden !important;
  z-index: -1 !important;
}

.drop-zone {
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-16);
  text-align: center;
  background: var(--bg-secondary);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left var(--transition-slow);
}

.drop-zone:hover {
  border-color: var(--color-primary);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-style: solid;
}

.drop-zone:hover::before {
  left: 100%;
}

.drop-zone.drag-over {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.1);
  border-style: solid;
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

.drop-zone.drag-over .drop-icon {
  color: var(--color-primary);
  transform: scale(1.1);
}

.drop-zone.drag-over h3,
.drop-zone.drag-over p {
  color: var(--color-primary);
}

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

.drop-icon {
  font-size: 4rem;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  display: block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.drop-zone h3 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  color: var(--font-color);
}

.drop-zone p {
  color: var(--font-color-secondary);
  margin: var(--space-4) 0 var(--space-6) 0;
  font-size: var(--font-size-lg);
}

.drop-zone .button {
  margin: var(--space-2) 0 var(--space-6) 0;
  font-size: var(--font-size-lg);
  padding: var(--space-4) var(--space-8);
}

.upload-info {
  margin-top: var(--space-6);
}

.text-small {
  font-size: var(--font-size-sm);
  color: var(--font-color-muted);
  margin: 0;
}

/* Progress Section */
.progress-section {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--border-color);
  /* Movement: Pulse animation when active */
  animation: subtlePulse 2s ease-in-out infinite;
  /* Balance: Enhanced visual presence */
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.progress-section.active,
#progress-section.active,
.progress-section:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
}

.progress-section.active .progress-bar {
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
  height: 12px !important;
  width: 100% !important;
  display: block !important;
}

.progress-section.active .progress-fill {
  background: linear-gradient(90deg, #2563eb, #0891b2) !important;
  height: 100% !important;
  display: block !important;
  min-width: 3px !important;
}

@keyframes subtlePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
  50% {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
  }
}

.progress-container {
  width: 100%;
}

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

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0 !important;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #cbd5e1 !important;
  display: block !important;
  visibility: visible !important;
}

.progress-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #2563eb, #0891b2) !important;
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  position: relative;
  min-width: 2px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
  display: block !important;
  visibility: visible !important;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 35%, rgba(255, 255, 255, 0.2) 35%, rgba(255, 255, 255, 0.2) 65%, transparent 65%);
  background-size: 20px 20px;
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  /* Contrast: Enhanced border with gradient */
  border-bottom: 2px solid transparent;
  background: linear-gradient(to right, var(--border-color), transparent, var(--border-color)) bottom/100% 2px no-repeat;
  position: relative;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-2xl);
  font-weight: 600;
  margin: 0;
  color: var(--font-color);
}

/* File List */
.file-list {
  display: grid;
  gap: var(--space-4);
}

.file-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.file-item:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.file-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.file-info h4 {
  font-weight: 600;
  margin: 0 0 var(--space-1) 0;
  color: var(--font-color);
  word-break: break-word;
}

.file-meta {
  font-size: var(--font-size-sm);
  color: var(--font-color-muted);
  display: flex;
  gap: var(--space-4);
}

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


/* Format Options */
.format-options {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  border: 1px solid var(--border-color);
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.toggle-item {
  display: flex;
  align-items: center;
}

.toggle-item label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  color: var(--font-color);
  cursor: pointer;
  user-select: none;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin-left: var(--space-3);
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-gray-300);
  transition: var(--transition-base);
  border-radius: var(--radius-full);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-base);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Statistics */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  /* Hierarchy: Make stats more prominent */
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
}

.stat-item {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-fast);
  /* Movement: Add subtle transform and enhanced shadow */
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
  /* Contrast: Improved visual separation */
  position: relative;
  overflow: hidden;
}

.stat-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
  /* Movement: Add background animation */
  background: linear-gradient(135deg, var(--bg-color), var(--bg-secondary));
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
  transition: left var(--transition-slow);
}

.stat-item:hover::before {
  left: 100%;
}

.stat-item .material-icons-round {
  color: var(--color-primary);
  font-size: 1.5rem;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--font-color);
  line-height: 1;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--font-color-muted);
  font-weight: 500;
}

/* Current File Display */
.current-file-display {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
}

.current-file-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.current-file-info .material-icons-round {
  font-size: 1.1rem;
  color: var(--color-primary);
}

#current-file-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--font-color);
  font-family: var(--font-family);
}

/* Text Output */
.text-output-container {
  position: relative;
  margin-bottom: var(--space-6);
}

.text-output {
  width: 100%;
  height: 40vh !important;
  min-height: 40vh !important;
  max-height: none !important;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--font-color);
  resize: vertical;
  transition: all var(--transition-fast);
  /* Balance: Better visual weight */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Contrast: Subtle texture */
  background-image: linear-gradient(45deg, transparent 25%, rgba(0, 0, 0, 0.01) 25%, rgba(0, 0, 0, 0.01) 50%, transparent 50%);
  background-size: 20px 20px;
}

.text-output:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.text-output::placeholder {
  color: var(--font-color-muted);
  font-style: italic;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  border: none;
  font-weight: 600;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.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 var(--transition-base);
}

.button:hover::before {
  left: 100%;
}

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

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

.button.primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}

.button.secondary {
  background: var(--bg-secondary);
  color: var(--font-color);
  border: 1px solid var(--border-color);
}

.button.secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.button:disabled::before {
  display: none;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Export Dropdown */
.export-dropdown {
  position: relative;
}

.export-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  margin-top: var(--space-2);
}

.export-dropdown:hover .export-menu,
.export-dropdown:focus-within .export-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.export-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  color: var(--font-color);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  font-size: var(--font-size-sm);
  text-align: left;
}

.export-option:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.export-option:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.export-option:hover {
  background: var(--bg-secondary);
}


/* Flash Messages */
.flash-banner-container {
  margin: var(--space-4) 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-weight: 500;
  display: none;
  align-items: center;
  gap: var(--space-3);
  animation: slideInDown 0.3s ease-out;
}

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

.flash-banner-success {
  background: rgba(5, 150, 105, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.flash-banner-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.flash-banner-warning {
  background: rgba(217, 119, 6, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.flash-banner-info {
  background: rgba(8, 145, 178, 0.1);
  color: var(--color-info);
  border: 1px solid rgba(8, 145, 178, 0.2);
}

/* Footer */
footer {
  margin-top: var(--space-20);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.footer-content p {
  color: var(--font-color-secondary);
  margin: 0;
  flex: 1;
  min-width: 300px;
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  color: var(--font-color-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-primary);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Override hidden class for active progress section */
#progress-section.active.hidden,
.progress-section.active.hidden {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: var(--space-3);
  }

  .wrapper {
    max-width: 100%;
  }

  .hero h1 {
    font-size: var(--font-size-3xl);
  }

  .hero p {
    font-size: var(--font-size-lg);
  }

  .header-top {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .branding {
    font-size: var(--font-size-2xl);
  }

  .drop-zone {
    padding: var(--space-8);
    min-height: 250px;
  }

  .drop-icon {
    font-size: 3rem;
  }

  .drop-zone .button {
    font-size: var(--font-size-base);
    padding: var(--space-3) var(--space-6);
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }

  .section-header h2 {
    justify-content: center;
  }


  .toggle-group {
    flex-direction: column;
    gap: var(--space-4);
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-buttons {
    flex-direction: column;
  }

  .export-dropdown {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-content p {
    min-width: auto;
  }

  .text-output {
    height: 35vh !important;
    min-height: 35vh !important;
    max-height: none !important;
  }

}

@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: 1fr;
  }

  .drop-zone h3 {
    font-size: var(--font-size-xl);
  }

  .file-item-header {
    flex-direction: column;
    gap: var(--space-3);
  }

  .file-meta {
    flex-direction: column;
    gap: var(--space-1);
  }
}

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

.loading {
  animation: pulse 2s infinite;
}

/* Print Styles */
@media print {
  .header-controls,
  .upload-section,
  .progress-section,
  .action-buttons,
  .format-options,
  footer {
    display: none !important;
  }

  .text-output {
    border: none;
    background: transparent;
    box-shadow: none;
  }
}