/* 이미지 OCR 전용 스타일 */

nav { max-width: 800px; }
main { max-width: 800px; }

.lang-section {
  padding: 0.95rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 0.55rem;
}

.lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.lang-chip:hover {
  border-color: var(--primary);
}
.lang-chip:has(input:checked) {
  background: rgba(102, 126, 234, 0.12);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.lang-chip input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
}

.lang-hint {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.45;
}

/* 드롭존 */
.dropzone {
  display: block;
  cursor: pointer;
  margin-bottom: 1rem;
  padding: 2.2rem 1rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 14px;
  text-align: center;
  transition: all 0.15s;
}
.dropzone:hover,
.dropzone:focus,
.dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.04);
  outline: none;
}

.dropzone-content svg {
  color: var(--text-sub);
  margin-bottom: 0.85rem;
}

.dropzone-content p {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.dropzone-content .hint {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 0;
}

/* 미리보기 */
.preview-wrap {
  position: relative;
  margin-bottom: 1rem;
  padding: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.preview-wrap[hidden] { display: none; }

.preview-wrap img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.btn-clear {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-clear:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* 액션 버튼 */
.actions {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  min-height: 44px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--error);
  color: var(--error);
}

/* 진행률 */
.progress-wrap {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.progress-wrap[hidden] { display: none; }

.progress-status {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.25s ease-out;
}

/* 에러 */
.error {
  margin-bottom: 1rem;
  padding: 0.75rem 0.95rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.85rem;
}
.error[hidden] { display: none; }

/* 결과 */
.result-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.result-section[hidden] { display: none; }

.result-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.result-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.result-confidence {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  padding: 0.15rem 0.55rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
}

.result-actions {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
}

.btn-copy,
.btn-download {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy:hover,
.btn-download:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#result-text {
  width: 100%;
  padding: 0.95rem 1rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  border: none;
  outline: none;
  resize: vertical;
  min-height: 220px;
}

@media (max-width: 480px) {
  .preview-wrap img { max-height: 260px; }
  .actions .btn-primary,
  .actions .btn-secondary { flex: 1; }
  .result-actions { width: 100%; }
  .result-actions .btn-copy,
  .result-actions .btn-download { flex: 1; }
}
