/* ============================================================================
   PDF TICKET MERGER - STYLESHEET
   ============================================================================ */

/* ============================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================================================ */
:root {
  /* Color System */
  --primary: #0066cc;
  --primary-dark: #0052a3;
  --primary-light: #f0f7ff;

  --success: #28a745;
  --success-dark: #218838;
  --success-light: #d4edda;

  --warning: #f57f17;
  --warning-dark: #d2690f;
  --warning-light: #fff3cd;

  --error: #dc3545;
  --error-dark: #c82333;
  --error-light: #f8d7da;

  /* Gray Scale */
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  /* Status Colors */
  --status-info: var(--gray-200);
  --status-success: var(--success-light);
  --status-error: var(--error-light);
  --status-processing: var(--warning-light);

  /* Timing & Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ============================================================================
   PREFERS-REDUCED-MOTION
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: #ffffff;
  min-height: 100vh;
  padding: 20px;
  color: var(--gray-900);
}

/* ============================================================================
   LAYOUT CONTAINERS
   ============================================================================ */
.container {
  max-width: 800px; /* INCREASED FROM 600px */
  margin: 0 auto;
  background: white;
  border-radius: 0;
  overflow: hidden;
}

.main-content {
  padding: 40px 20px;
}

.spaced-paragraph {
  margin-bottom: 20px;
}

/* ============================================================================
   HEADER SECTION
   ============================================================================ */
.header {
  text-align: center;
  padding: 40px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.header h1 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 10px;
  color: var(--gray-900);
}

.header p {
  font-size: 1rem;
  color: var(--gray-600);
  font-weight: 300;
}

/* ============================================================================
   INSTRUCTIONS SECTION
   ============================================================================ */
.instructions {
  background: var(--gray-50);
  color: var(--gray-800);
  padding: 15px;
  margin-bottom: 20px;
  border-left: 2px solid var(--gray-300);
}

.instructions h2 {
  color: var(--gray-900);
  margin-bottom: 8px;
}

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

.instructions li {
  padding: 4px 0;
  color: var(--gray-800);
  font-size: 0.9rem;
}

.instructions li:before {
  content: "• ";
}

.instructions li.warning {
  color: #8b4513; /* Saddle brown */
  background: #fff3cd; /* Light yellow */
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
}

.instructions li.warning:before {
  content: "⚠ ";
}

.instructions li strong {
  color: var(--gray-900);
  font-weight: 600;
}

/* ============================================================================
   VISUAL EXAMPLES SECTION
   ============================================================================ */
.visual-examples {
  background: #f8fafc;
  padding: 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-md); /* ADDED CONSISTENT SHADOW */
}

.visual-examples h2 {
  color: var(--gray-900);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
  font-size: 1.2rem;
}

.example-box {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm); /* UPDATED TO USE VARIABLE */
}

.box-title {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 15px;
  text-align: center;
  font-size: 1.1rem;
  padding-bottom: 10px;
  border-bottom: 1px solid #f7fafc;
}

.example-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.example-section {
  flex: 1;
  min-width: 0;
}

.section-label {
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 10px;
  text-align: center;
  font-weight: 500;
}

/* Page Grid Layout */
.page-grid {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-item {
  text-align: center;
  flex: 1;
  min-width: 100px;
  max-width: 140px;
}

.page-item img {
  width: 100%;
  height: auto;
  max-height: 120px;
  border: 2px solid #cbd5e0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  object-fit: contain;
}

.page-item.small img {
  max-height: 80px;
}

.page-caption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--gray-800);
  line-height: 1.3;
}

.page-caption small {
  color: var(--gray-700);
  font-size: 0.75em;
}

/* PDF Pair Layout */
.pdf-pair {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.pdf-group {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.pdf-label {
  font-size: 0.85rem;
  color: #2d3748;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #edf2f7;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Arrow Section */
.arrow-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.arrow-icon {
  font-size: 1.8rem;
  color: #718096;
  margin-bottom: 5px;
}

.arrow-label {
  font-size: 0.8rem;
  color: #718096;
  writing-mode: horizontal-tb;
}

/* Output Item */
.output-item {
  text-align: center;
}

.output-item img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 8px rgba(72, 187, 120, 0.1);
  object-fit: contain;
}

.output-caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--gray-800);
  line-height: 1.3;
}

.output-caption small {
  color: var(--gray-700);
  font-size: 0.8em;
}

.box-description {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f7fafc;
  font-size: 0.9rem;
  color: var(--gray-800);
}

.box-description strong {
  color: #2d3748;
}

/* ============================================================================
   MINIMAL FAQ SECTION
   ============================================================================ */

/* Container - matches your .instructions box */
.faq-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

/* FAQ items - minimal border like your file items */
.faq-section details {
  margin-bottom: 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
  transition: border-color var(--transition-base);
}

.faq-section details:hover {
  border-color: var(--primary);
}

.faq-section details[open] {
  border-color: var(--primary);
  border-left: 3px solid var(--primary);
}

/* Summary - matches your button/header style */
.faq-section summary {
  padding: 12px 15px;
  background: var(--gray-50);
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.95rem;
  list-style: none;
  transition: background-color var(--transition-base);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-section summary:hover {
  background: var(--primary-light);
}

.faq-section details[open] summary {
  background: var(--primary-light);
  color: var(--gray-900);
}

/* Remove default arrow */
.faq-section summary::-webkit-details-marker {
  display: none;
}

/* Custom arrow - matches your clean style */
.faq-section summary::after {
  content: "▼";
  font-size: 0.7rem;
  color: var(--gray-500);
  margin-left: auto;
  transition: transform var(--transition-base);
}

.faq-section details[open] summary::after {
  transform: rotate(180deg);
  color: var(--primary);
}

/* FAQ answer - matches your text style */
.faq-section .faq-answer {
  padding: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--gray-800);
  background: white;
  border-top: 1px solid var(--gray-200);
}

.faq-section .faq-answer p {
  margin-bottom: 15px;
}

.faq-section .faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-section .faq-answer ul,
.faq-section .faq-answer ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

.faq-section .faq-answer li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.faq-section .faq-answer strong {
  color: var(--gray-900);
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .faq-section {
    padding: 12px;
    margin: 15px 0;
  }

  .faq-section summary {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .faq-section .faq-answer {
    padding: 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .faq-section summary {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .faq-section summary::after {
    font-size: 0.6rem;
  }

  .faq-section .faq-answer {
    padding: 10px;
  }

  .faq-section .faq-answer ul,
  .faq-section .faq-answer ol {
    margin-left: 15px;
  }
}
/* ============================================================================
   FILE UPLOAD SECTION
   ============================================================================ */
.upload-section {
  text-align: center;
  margin-bottom: 30px;
}

.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-none);
  padding: 40px 20px;
  margin-bottom: 20px;
  transition: border-color var(--transition-base),
    background-color var(--transition-base);
  background: var(--gray-50);
  cursor: pointer;
}

.drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone.dragover {
  border-color: var(--gray-600);
  background: var(--gray-200);
}

.drop-zone.limit-reached {
  border-color: var(--warning);
  background: #fff8e1;
}

.drop-zone.limit-reached h3 {
  color: var(--warning);
}

.drop-zone-icon {
  font-size: 3rem;
  color: var(--gray-600);
  margin-bottom: 10px;
}

.drop-zone h3 {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.drop-zone p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.file-count-info {
  font-size: 0.8rem;
  color: var(--gray-700);
  background: var(--gray-200);
  margin-top: 10px;
}

.file-input {
  display: none;
}

/* ============================================================================
   BUTTONS WITH FOCUS STATES
   ============================================================================ */
.browse-btn {
  background: var(--gray-900);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-none);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--transition-base);
}

.browse-btn:hover {
  background: #000;
}

.browse-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.browse-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(0, 0, 0, 0.05) 5px,
    rgba(0, 0, 0, 0.05) 10px
  );
}

/* NEW: Enhanced focus indicators for all interactive elements */
.browse-btn:focus,
.process-btn:focus,
.download-zip-btn:focus,
.download-link:focus,
.file-item button:focus {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* Remove default focus for mouse users but keep for keyboard */
.browse-btn:focus:not(:focus-visible),
.process-btn:focus:not(:focus-visible),
.download-zip-btn:focus:not(:focus-visible),
.download-link:focus:not(:focus-visible),
.file-item button:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================================
   FILE LIST SECTION
   ============================================================================ */
.file-list {
  background: var(--gray-50);
  padding: 15px;
  margin-bottom: 20px;
  display: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); /* ADDED CONSISTENT SHADOW */
}

.file-list h3 {
  font-size: 1rem;
  color: var(--gray-900);
}

.file-items {
  max-height: 200px;
  overflow-y: auto;
}

/* Custom Scrollbar Styling */
.file-items::-webkit-scrollbar {
  width: 6px;
}

.file-items::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 3px;
}

.file-items::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 3px;
  transition: background-color var(--transition-base);
}

.file-items::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  margin-bottom: 5px;
  border: 1px solid var(--gray-200);
  transition: border-color var(--transition-base);
  border-radius: var(--radius-sm);
}

.file-item:hover {
  border-color: var(--gray-300);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.file-info div:first-child {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.file-name {
  font-size: 0.9rem;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-status {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-block;
  transition: all var(--transition-base);
}

.status-valid {
  background: #d1fae5;
  color: var(--gray-900);
  border: 1px solid var(--success);
}

.status-valid:before {
  content: "✓ ";
  font-weight: bold;
  margin-right: 2px;
}

.status-invalid {
  background: var(--error-light);
  color: #d32f2f;
}

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

.file-item button {
  background: var(--gray-900);
  color: white;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-none);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition-base);
}

.file-item button:hover {
  background: #000;
}

.file-item button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.file-count {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 10px;
  padding: 5px;
  background: var(--gray-100);
  text-align: center;
  border-radius: var(--radius-sm);
}

/* ============================================================================
   ACTION BUTTONS SECTION
   ============================================================================ */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.process-btn {
  flex: 1;
  min-width: 150px;
  padding: 10px 15px;
  border: 1px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: var(--radius-none);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--transition-base),
    color var(--transition-base), border-color var(--transition-base);
}

.process-btn:not(:disabled):hover {
  background: var(--primary);
  color: white;
}

.process-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.process-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--gray-400);
  color: var(--gray-500);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(0, 0, 0, 0.05) 5px,
    rgba(0, 0, 0, 0.05) 10px
  );
}

/* ============================================================================
   STATUS & PROGRESS SECTION
   ============================================================================ */
.status-section {
  margin-bottom: 20px;
}

.status {
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.status-info {
  background: var(--gray-100);
  color: var(--gray-900);
  border-left: 4px solid var(--gray-600);
}

.status-success {
  background: var(--success-light);
  color: var(--gray-900);
  border-left: 4px solid var(--success);
}

.status-error {
  background: var(--error-light);
  color: var(--gray-900);
  border-left: 4px solid var(--error);
}

.status-processing {
  background: var(--warning-light);
  color: var(--gray-900);
  border-left: 4px solid var(--warning);
}

.progress-bar {
  height: 4px;
  background: var(--gray-200);
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 2px;
}

.progress-fill {
  height: 100%;
  background: var(--gray-900);
  width: 0%;
  transition: width var(--transition-base);
}

/* ============================================================================
   DOWNLOAD SECTION
   ============================================================================ */
.download-section {
  background: var(--gray-50);
  padding: 15px;
  display: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); /* ADDED CONSISTENT SHADOW */
}

.download-section h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--gray-900);
}

.download-list {
  max-height: 200px;
  overflow-y: auto;
}

/* Download List Scrollbar */
.download-list::-webkit-scrollbar {
  width: 6px;
}

.download-list::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 3px;
}

.download-list::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 3px;
  transition: background-color var(--transition-base);
}

.download-list::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  margin-bottom: 5px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-base);
}

.download-item:hover {
  border-color: var(--gray-300);
}

.download-item-info {
  flex: 1;
  min-width: 0;
}

.download-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--gray-900);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-item small {
  color: var(--gray-700);
  font-size: 0.8rem;
}

.download-link {
  background: var(--success);
  color: white;
  padding: 4px 12px;
  text-decoration: none;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-base);
  border-radius: var(--radius-sm);
}

.download-link:hover {
  background: var(--success-dark);
}

.download-link:focus {
  outline: 2px solid var(--success);
  outline-offset: 2px;
}

/* ============================================================================
   GITHUB FOOTER SECTION
   ============================================================================ */
.github-minimal-footer {
  margin-top: 40px;
  padding: 20px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  text-align: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); /* ADDED CONSISTENT SHADOW */
}

.footer-text {
  color: var(--gray-700);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.footer-label {
  display: inline-block;
  margin-right: 8px;
}

.footer-link {
  color: var(--gray-900);
  text-decoration: none;
  font-weight: 500;
  padding: 2px 4px;
  border-bottom: 1px solid transparent;
  transition: all var(--transition-base);
}

.footer-link:hover {
  color: #000000;
  border-bottom-color: var(--gray-900);
}

.footer-link:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================================
   ZIP DOWNLOAD STYLES (reusing existing patterns)
   ============================================================================ */

/* Download All Container - matches your .download-section style */
.download-all-item {
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  padding: 12px 15px;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary);
  transition: border-color var(--transition-base);
  border-radius: var(--radius-sm);
}

.download-all-item:hover {
  border-left-color: var(--primary-dark);
}

.download-all-item .download-item-info {
  color: var(--gray-900);
}

.download-all-item .download-item-info small {
  color: var(--gray-600);
  font-size: 0.8rem;
}

/* ZIP Header - similar to your .download-item strong but with icon */
.zip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.zip-icon {
  font-size: 1.2rem;
  color: var(--primary);
}

.download-all-item strong {
  color: var(--gray-900);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ZIP Button - matches your .process-btn style but different color */
.download-zip-btn {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-none);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--transition-base),
    color var(--transition-base);
  min-width: 150px;
  white-space: nowrap;
}

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

.download-zip-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.download-zip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(0, 0, 0, 0.05) 5px,
    rgba(0, 0, 0, 0.05) 10px
  );
}

/* Separator - matches your clean aesthetic */
.download-separator {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--gray-300),
    transparent
  );
  margin: 15px 0;
  width: 100%;
}

/* File list details - matches your .file-list style */
.file-list {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
  padding: 0;
  margin: 0;
}

/* ============================================================================
   ZIP BUTTON RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
  .download-all-item {
    padding: 10px;
    margin-bottom: 10px;
  }

  .download-zip-btn {
    min-width: auto;
    width: 100%;
    padding: 10px;
  }

  .zip-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 8px;
  }

  .zip-icon {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .download-all-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .download-zip-btn {
    align-self: stretch;
    text-align: center;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .file-list {
    font-size: 0.7rem;
  }
}

@media (max-width: 360px) {
  .download-zip-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .download-all-item strong {
    font-size: 0.85rem;
  }
}

/* ============================================================================
   RESPONSIVE DESIGN - TABLET (≤768px)
   ============================================================================ */
@media (max-width: 768px) {
  .header {
    padding: 30px 15px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .main-content {
    padding: 20px 15px;
  }

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

  .process-btn {
    min-width: auto;
    width: 100%;
  }

  .file-name {
    max-width: 150px;
  }

  .drop-zone {
    padding: 30px 15px;
  }

  /* Prevent iOS zoom on form elements */
  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  /* Visual Examples Adjustments */
  .visual-examples {
    padding: 15px;
  }

  .example-container {
    flex-direction: column;
    gap: 15px;
  }

  .example-section {
    width: 100%;
  }

  .arrow-section {
    flex-direction: row;
    gap: 10px;
    min-width: auto;
    width: 100%;
    justify-content: center;
    margin: 5px 0;
  }

  .arrow-icon {
    margin-bottom: 0;
    margin-right: 10px;
  }

  .arrow-label {
    color: var(--gray-800);
    font-weight: 600;
    writing-mode: horizontal-tb;
  }

  .page-grid {
    gap: 8px;
  }

  .page-item {
    min-width: 80px;
    max-width: 120px;
  }

  .page-item img {
    max-height: 100px;
  }

  .page-item.small img {
    max-height: 70px;
  }

  .pdf-pair {
    gap: 20px;
  }

  .pdf-group {
    min-width: 100px;
  }

  .output-item img {
    max-width: 180px;
  }

  /* GitHub Footer Adjustments */
  .github-minimal-footer {
    margin-top: 30px;
    padding: 15px;
  }

  .footer-text {
    font-size: 0.85rem;
  }
}

/* ============================================================================
   RESPONSIVE DESIGN - MOBILE (≤480px)
   ============================================================================ */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  /* Larger tap targets */
  .file-item button {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .browse-btn,
  .process-btn {
    padding: 12px 20px;
    min-height: 44px; /* Minimum tap target size */
  }

  /* File name display */
  .file-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  /* Download items */
  .download-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .download-link {
    align-self: stretch;
    text-align: center;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Progress bar */
  .progress-bar {
    height: 6px;
  }

  /* Status messages */
  .status {
    font-size: 1rem;
    padding: 12px;
    min-height: 70px;
  }

  /* Instructions */
  .instructions {
    font-size: 0.95rem;
    padding: 12px;
  }

  /* Drop zone */
  .drop-zone {
    padding: 20px 10px;
  }

  .drop-zone h3 {
    color: var(--gray-900);
    font-size: 1.1rem;
  }

  .drop-zone p {
    color: var(--gray-700);
    font-size: 0.85rem;
  }

  /* Visual Examples Adjustments */
  .visual-examples {
    padding: 12px;
  }

  .example-box {
    padding: 12px;
  }

  .page-item {
    min-width: 70px;
    max-width: 100px;
  }

  .page-item img {
    max-height: 90px;
  }

  .page-item.small img {
    max-height: 60px;
  }

  .pdf-pair {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .pdf-group {
    width: 100%;
    max-width: 200px;
  }

  .output-item img {
    max-width: 160px;
  }

  .box-description {
    font-size: 0.85rem;
    padding-top: 12px;
    margin-top: 12px;
  }

  /* GitHub Footer Adjustments */
  .github-minimal-footer {
    margin-top: 25px;
    padding: 12px;
  }

  .footer-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .footer-label {
    margin-right: 0;
    margin-bottom: 3px;
  }
}

/* ============================================================================
   RESPONSIVE DESIGN - VERY SMALL MOBILE (≤360px)
   ============================================================================ */
@media (max-width: 360px) {
  .file-name {
    max-width: 140px;
  }

  .header h1 {
    font-size: 1.3rem;
  }

  .drop-zone-icon {
    font-size: 2.5rem;
  }

  .browse-btn,
  .process-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  /* Visual Examples Adjustments */
  .page-grid {
    flex-direction: column;
    align-items: center;
  }

  .page-item {
    max-width: 150px;
    width: 100%;
  }

  .page-item img {
    max-height: 110px;
  }

  .output-item img {
    max-width: 140px;
  }
}

/* ============================================================================
   VISUAL INDICATORS (Desktop only)
   ============================================================================ */
@media (min-width: 769px) {
  .example-container {
    position: relative;
  }

  .example-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    z-index: 0;
    display: block;
  }

  .example-section,
  .arrow-section {
    position: relative;
    z-index: 1;
    background: white;
    padding: 10px;
  }

  .arrow-section {
    background: transparent;
  }
}
