* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f8f9fa;
  color: #333;
  margin: 0;
  line-height: 1.6;
}

/* Header */
header {
  text-align: center;
  background: #007bff;
  color: #fff;
  padding: 2.5rem 1rem;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
}

header p.intro {
  margin: 0.75rem auto 0;
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 800px;
}

/* Layout */
main {
  max-width: 1200px;
  margin: auto;
  padding: 2rem 1rem;
}

section {
  background: #fff;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

hr {
  border: 0;
  height: 1px;
  background: #e9ecef;
  margin: 2.5rem 0;
}

/* Section titles */
.section-title {
  text-align: center;
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: #007bff;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin: 0.25rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #007bff;
  color: #fff;
}

.btn-primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #a0cfff;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background: #545b62;
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  background: #c8cbcf;
  cursor: not-allowed;
  transform: none;
}

/* Tool container */
.tool-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed #007bff;
  border-radius: 12px;
  padding: 3rem 1.5rem;
  text-align: center;
  background: #f8f9ff;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}

.upload-zone:hover {
  background: #e9f0ff;
  border-color: #0056b3;
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-zone .upload-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.upload-zone p {
  margin: 0.25rem 0;
  color: #333;
  font-size: 1rem;
}

.upload-zone .upload-hint {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Spec Table */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 1.5rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  margin: 0;
  font-size: 0.93rem;
  min-width: 600px;
}

.spec-table th {
  background: #007bff;
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.spec-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e9ecef;
  color: #444;
}

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

.spec-table tr:nth-child(even) td {
  background: #f8f9fa;
}

.file-note {
  font-size: 0.88rem;
  margin-top: 0.5rem;
  background: #fff8e1;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  line-height: 1.4;
}

/* Global Progress */
.global-progress-bar {
  background: #e9f0ff;
  border: 1px solid #b8daff;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.global-progress-text {
  font-weight: 600;
  color: #004085;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #dee2e6;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #007bff;
  width: 0%;
  transition: width 0.3s ease;
}

/* File list queue */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.file-item {
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.file-item:hover {
  border-color: #ced4da;
}

@media (min-width: 768px) {
  .file-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.file-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  object-fit: cover;
  background: #fff;
}

.file-placeholder-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  border: 1px dashed #ced4da;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
  word-break: break-all;
}

.file-meta {
  font-size: 0.85rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.file-size-badge {
  display: inline-block;
  background: #6c757d;
  color: #fff;
  border-radius: 12px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.file-size-badge.jpg {
  background: #28a745;
}

.file-status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.file-status-badge.pending {
  background: #ffeeba;
  color: #856404;
}

.file-status-badge.converting {
  background: #cce5ff;
  color: #004085;
}

.file-status-badge.success {
  background: #d4edda;
  color: #155724;
}

.file-status-badge.error {
  background: #f8d7da;
  color: #721c24;
}

.file-item-progress {
  width: 100%;
  margin-top: 0.5rem;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

@media (min-width: 768px) {
  .file-actions {
    margin-top: 0;
  }
}

/* Steps section */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.step {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  background: #007bff;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  margin: 0 auto 1rem;
}

.step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #333;
}

.step p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
}

/* Benefits list */
.benefits-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.benefits-grid li {
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  border-radius: 0 8px 8px 0;
  padding: 1.25rem;
  font-size: 0.95rem;
  color: #444;
}

.benefits-grid li strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #007bff;
}

/* Note box */
.note-box {
  text-align: center;
  margin: 2rem auto 0;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #666;
}

.note-box p {
  margin: 0;
}

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid #e9ecef;
  padding: 0.25rem 0;
}

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

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
  padding: 1.25rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}

.faq-question:hover {
  color: #007bff;
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: #007bff;
  font-weight: bold;
  margin-left: 1rem;
  transition: transform 0.2s;
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, padding 0.25s ease-out;
}

.faq-item.active .faq-answer {
  max-height: 1000px;
  padding-bottom: 1.25rem;
}

.faq-answer p {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #f8f9fa;
  color: #666;
  border-top: 1px solid #e9ecef;
  margin-top: 4rem;
  font-size: 0.9rem;
}

footer a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

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

/* SEO Content typography */
#seo-content h3 {
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

#seo-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

#seo-content li {
  margin-bottom: 0.4rem;
}

/* File upload info area (spec table wrapper) */
.file-upload-area {
  border: 1px dashed #007bff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  background: #f8f9ff;
}

.file-upload-area h3 {
  margin-top: 0;
  color: #007bff;
  font-size: 1.05rem;
}

/* Buttons row */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Progress pulse animation for converting items */
@keyframes progressPulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Section h2 underline accent */
section h2.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #007bff;
  border-radius: 2px;
  margin: 0.5rem auto 0;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.8rem;
  }
  header p.intro {
    font-size: 0.95rem;
  }
  section {
    padding: 1.25rem;
  }
  .section-title {
    font-size: 1.4rem;
  }
  .buttons {
    flex-direction: column;
    width: 100%;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
    margin: 0.25rem 0;
  }
}
