:root {
  /* Light theme colors */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --success-color: #10b981;
  --error-color: #ef4444;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --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);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
}

/* Dark theme */
[data-theme="dark"] {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --success-color: #10b981;
  --error-color: #f87171;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: var(--spacing-lg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
  color: white;
  padding: var(--spacing-2xl) var(--spacing-xl);
  text-align: left;
  position: relative;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
}

.header-actions {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

[data-theme="dark"] header {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.3s ease;
}

.theme-icon svg {
  width: 20px;
  height: 20px;
  color: currentColor;
  transition: transform 0.3s ease;
}

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

.language-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

#languageIcon {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.language-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.language-toggle:active {
  transform: scale(0.95);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
  font-weight: 400;
  text-align: left;
}

/* Main Content */
main {
  padding: var(--spacing-xl);
}

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

.upload-area {
  border: 3px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 60px var(--spacing-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-color);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .upload-area:hover {
  background: #1e293b;
  border-color: var(--primary-color);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background: #eff6ff;
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .upload-area.dragover {
  background: #1e293b;
  border-color: var(--primary-color);
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-lg);
  color: var(--primary-color);
  stroke-width: 2;
}

.upload-content h2 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  font-weight: 600;
}

.upload-content p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--success-color);
  color: white;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-md);
  box-shadow: var(--shadow);
}

.file-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn-remove {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-remove:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-remove:active {
  transform: scale(0.95);
}

/* Files List */
.files-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

/* File Preview Card */
.file-preview-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

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

/* File Preview Header */
.file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.file-preview-header:hover {
  background: var(--bg-color);
}

.file-header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
  min-width: 0;
}

.file-status-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-left: 0;
}

.file-status-icon.success {
  color: var(--success-color);
}

.file-status-icon.processing {
  color: var(--primary-color);
  animation: pulse 1.5s ease-in-out infinite;
}

.file-status-icon.error {
  color: var(--error-color);
}

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

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

.file-stats {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.file-error {
  font-size: 0.85rem;
  color: var(--error-color);
  font-style: italic;
}

.file-header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

.btn-download-file,
.collapse-btn,
.remove-file-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.btn-download-file {
  font-size: 0; /* Remove espaço extra do SVG */
}

.btn-download-file svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.btn-download-file:hover {
  background: var(--primary-color);
  color: white;
}

.btn-download-file:hover svg {
  color: white;
}

.collapse-btn {
  order: -1; /* Move para o início do flex container */
  flex-shrink: 0;
}

.collapse-btn:hover {
  background: var(--bg-color);
  color: var(--text-primary);
  transform: scale(1.1);
}

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

/* File Preview Content */
.file-preview-content {
  padding: var(--spacing-md);
  transition: all 0.3s ease;
  max-height: 2000px;
  overflow: hidden;
}

.file-preview-content.collapsed {
  max-height: 0;
  padding: 0 var(--spacing-md);
  overflow: hidden;
}

/* File Preview Controls */
.file-preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.file-preview-controls-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.file-preview-controls-left label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.file-preview-controls-left select {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.file-preview-controls-left select:hover {
  border-color: var(--primary-color);
}

.file-preview-controls-left select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.file-preview-controls-right {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* File Preview Table */
.file-preview-table-wrapper {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  margin-bottom: var(--spacing-md);
}

.file-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.file-preview-table thead {
  position: sticky;
  top: 0;
  background: var(--primary-color);
  color: white;
  z-index: 10;
}

.file-preview-table th {
  padding: var(--spacing-sm);
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-preview-table td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.file-preview-table tbody tr:hover {
  background: var(--bg-color);
}

.file-preview-table tbody tr:last-child td {
  border-bottom: none;
}

/* File Pagination Controls */
.file-pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) 0;
}

.file-pagination-btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.file-pagination-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.file-pagination-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: center;
}

.btn-secondary {
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--card-bg);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

/* Options Section */
.options-section {
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: var(--bg-color);
  border-radius: var(--radius-md);
}

.options-section h3 {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.option-item {
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.option-item.checkbox-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

.option-item.checkbox-option:hover {
  background: var(--card-bg);
}

.option-item.checkbox-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.option-item.checkbox-option span {
  user-select: none;
  color: var(--text-primary);
}

.option-item.select-option {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.option-item.select-option label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  user-select: none;
}

.option-item.select-option select {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.option-item.select-option select:hover {
  border-color: var(--primary-color);
}

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

[data-theme="dark"] .option-item.select-option select {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Preview Section */
.preview-section {
  margin-bottom: var(--spacing-xl);
}

.preview-section h3 {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
}

.preview-container {
  background: var(--bg-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
}

.preview-table-wrapper {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.preview-table thead {
  position: sticky;
  top: 0;
  background: var(--primary-color);
  color: white;
  z-index: 10;
}

.preview-table th {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  border-top: 1px solid var(--border-color);
  color: var(--text-primary);
  background: var(--card-bg);
}

.preview-table tbody tr:hover {
  background: var(--bg-color);
}

[data-theme="dark"] .preview-table tbody tr:hover {
  background: #334155;
}

.preview-table tbody tr:last-child td {
  border-bottom: none;
}

.preview-stats {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

/* Preview Controls */
.preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.preview-controls-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.preview-controls-left label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.preview-controls-left select {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.preview-controls-left select:hover {
  border-color: var(--primary-color);
}

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

.preview-controls-right {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

[data-theme="dark"] .preview-controls-left select {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) 0;
}

.pagination-btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.page-info {
  padding: 0 var(--spacing-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Action Section */
.action-section {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-2xl);
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

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

/* Status Message */
.status-message {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  display: none;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

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

.status-message.show {
  display: block;
}

.status-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid var(--success-color);
}

[data-theme="dark"] .status-message.success {
  background: #064e3b;
  color: #d1fae5;
  border: 1px solid var(--success-color);
}

.status-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid var(--error-color);
}

[data-theme="dark"] .status-message.error {
  background: #7f1d1d;
  color: #fee2e2;
  border: 1px solid var(--error-color);
}

/* Ad Container */
.ad-container {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-lg);
  background: var(--bg-color);
  border-radius: var(--radius-md);
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
footer {
  background: var(--bg-color);
  padding: var(--spacing-xl);
  text-align: center;
  border-top: 1px solid var(--border-color);
}

footer p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

footer p strong {
  color: var(--text-primary);
}

.footer-links {
  margin-top: var(--spacing-md);
}

.footer-links a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.9rem;
}

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

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

  header {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .header-content {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .header-actions {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    gap: var(--spacing-xs);
  }

  .theme-toggle,
  .language-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  main {
    padding: var(--spacing-lg);
  }

  .upload-area {
    padding: 40px var(--spacing-md);
  }

  .upload-content h2 {
    font-size: 1.25rem;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .preview-table-wrapper {
    max-height: 300px;
  }

  .preview-table {
    font-size: 0.85rem;
  }

  .preview-table th,
  .preview-table td {
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .file-preview-header {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
  
  .file-header-left {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .file-preview-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .file-preview-controls-left,
  .file-preview-controls-right {
    justify-content: center;
    width: 100%;
  }
  
  .file-pagination-controls {
    flex-wrap: wrap;
  }
  
  .file-pagination-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.75rem;
  }

  .upload-icon {
    width: 48px;
    height: 48px;
  }

  .upload-content h2 {
    font-size: 1.1rem;
  }

  .upload-content p {
    font-size: 0.9rem;
  }
}

/* Accessibility */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus,
input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  body {
    background: white;
    padding: 0;
  }

  .container {
    box-shadow: none;
    border-radius: 0;
  }

  header {
    background: white;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
  }

  .upload-section,
  .options-section,
  .action-section,
  .ad-container,
  footer {
    display: none;
  }

  .preview-section {
    margin: 0;
  }

  .preview-table-wrapper {
    max-height: none;
    overflow: visible;
  }
}
