@charset "UTF-8";

/* =========================================================
   Image OCR Utility
========================================================= */

.image-ocr-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px;
}

.image-ocr-card {
  padding: 28px;
  border-radius: 24px;
}

/* =========================================================
   Upload
========================================================= */

.upload-box {
  padding: 42px 24px;
  border: 2px dashed #c7d2fe;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  text-align: center;
  transition: 0.2s ease;
}

.upload-box.drag-over {
  border-color: #6366f1;
  background: #eef2ff;
}

.upload-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 34px;
}

.upload-box h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: #111827;
}

.upload-box p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.7;
}

/* =========================================================
   Preview / Options
========================================================= */

.preview-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-top: 22px;
}

.preview-panel,
.option-panel,
.result-panel {
  padding: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #111827;
}

.panel-head span {
  font-size: 12px;
  color: #6b7280;
  word-break: break-all;
}

/* =========================================================
   Image List
========================================================= */

.image-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.image-item {
  position: relative;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}

.image-thumb {
  height: 180px;
  background:
    linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
    linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
    linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-meta {
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.image-name {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  word-break: break-all;
}

.image-size {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.image-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  line-height: 30px;
  transition: 0.2s ease;
}

.image-remove-btn:hover {
  background: #dc2626;
}

/* =========================================================
   Options
========================================================= */

.option-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.option-item .utility-field-label {
  display: inline-flex;
  margin-bottom: 8px;
}

.option-item .utility-input {
  width: 100%;
}

.toggle-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  cursor: pointer;
  transition: 0.2s ease;
}

.toggle-item:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
}

.toggle-item input {
  width: 17px;
  height: 17px;
  accent-color: #4f46e5;
}

.toggle-item span {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

/* =========================================================
   Progress
========================================================= */

.progress-wrap {
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.progress-head span {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.25s ease;
}

/* =========================================================
   Result
========================================================= */

.result-panel {
  margin-top: 22px;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result-textarea {
  min-height: 260px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.7;
  background: #f9fafb;
}

.file-result-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.file-result-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
}

.file-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.file-result-head strong {
  font-size: 13px;
  color: #111827;
  word-break: break-all;
}

.file-result-head span {
  font-size: 12px;
  color: #6b7280;
  flex-shrink: 0;
}

.file-result-body {
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #374151;
  font-size: 13px;
  line-height: 1.7;
  max-height: 180px;
  overflow: auto;
}

/* =========================================================
   Status
========================================================= */

.status-box {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.7;
}

.status-box.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.status-box.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.status-box.loading {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

/* =========================================================
   Help
========================================================= */

.help-panel {
  margin-top: 26px;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.05);
}

.help-panel h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
  color: #111827;
}

.help-panel ul {
  margin: 0;
  padding-left: 18px;
}

.help-panel li {
  margin-bottom: 10px;
  color: #4b5563;
  line-height: 1.8;
  font-size: 14px;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 960px) {
  .preview-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .image-ocr-page {
    padding: 24px 14px;
  }

  .image-ocr-card {
    padding: 20px;
  }

  .upload-box {
    padding: 32px 18px;
  }

  .image-list {
    grid-template-columns: 1fr;
  }

  .toggle-area {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions .utility-btn {
    flex: 1;
  }

  .help-panel {
    padding: 22px 18px;
  }
}