/* Encoding fix (global encoding recovery) page - purple theme */
:root {
  --encoding-fix-primary: #6d28d9;
  --encoding-fix-primary-hover: #7c3aed;
  --encoding-fix-primary-muted: rgba(109, 40, 217, 0.12);
}

.encoding-fix-layout {
  max-width: 640px;
  margin: 0 auto;
}

.encoding-fix__badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--encoding-fix-primary);
  background: var(--encoding-fix-primary-muted);
  border-radius: 9999px;
}

.encoding-fix__section {
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.encoding-fix__section .section-title {
  margin-top: 0;
}

.encoding-fix__upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
}

.encoding-fix__upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.encoding-fix__upload:hover,
.encoding-fix__upload.encoding-fix__upload--dragover {
  border-color: var(--encoding-fix-primary);
  background: var(--encoding-fix-primary-muted);
}

.encoding-fix__upload-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: var(--encoding-fix-primary);
}

.encoding-fix__upload-icon svg {
  width: 100%;
  height: 100%;
}

.encoding-fix__upload-title {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.encoding-fix__upload-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.encoding-fix__encoding-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.encoding-fix__encoding-row label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.encoding-fix__encoding-select {
  min-width: 180px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  background: var(--bg-card);
}

.encoding-fix__preview-wrap {
  margin-top: 8px;
}

.encoding-fix__preview-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.encoding-fix__preview-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
}

.encoding-fix__detected {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.encoding-fix__detected strong {
  color: var(--text);
}

.encoding-fix__actions {
  margin-top: 20px;
}

.encoding-fix__actions .btn-primary {
  background: linear-gradient(145deg, #7c3aed 0%, #6d28d9 100%);
  border-color: #6d28d9;
  color: #fff;
}
.encoding-fix__actions .btn-primary:hover:not(:disabled) {
  background: linear-gradient(145deg, #8b5cf6 0%, #7c3aed 100%);
  border-color: #7c3aed;
}

.encoding-fix__message {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--encoding-fix-primary-muted);
  color: var(--encoding-fix-primary);
}

.encoding-fix__message--error {
  background: #fef2f2;
  color: var(--danger);
}

/* Description block (기능 설명) at bottom */
.encoding-fix__description {
  margin-top: 40px;
  padding: 28px 24px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.encoding-fix__description h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

.encoding-fix__description p,
.encoding-fix__description ul {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.encoding-fix__description ul {
  padding-left: 1.4em;
}

.encoding-fix__description li {
  margin-bottom: 6px;
}

.encoding-fix__description p:last-child {
  margin-bottom: 0;
}

/* ===== How it Works (이용 가이드) 섹션 - 인터랙티브 ===== */
.how-it-works {
  margin-top: 48px;
  padding: 40px 24px 48px;
  background: linear-gradient(180deg, #f5f3ff 0%, #f8fafc 100%);
  border-radius: var(--radius);
}

.how-it-works__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 0 0 24px;
}

.how-it-works__grid {
  max-width: 900px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 768px) {
  .how-it-works__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .how-it-works__arrow {
    display: none;
  }
}

.how-it-works__card {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.how-it-works__card:hover {
  border-color: var(--encoding-fix-primary);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.15);
}

.how-it-works__card.is-active {
  border-color: var(--encoding-fix-primary);
  background: var(--encoding-fix-primary-muted);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.2);
}

.how-it-works__card .how-it-works__step { margin-bottom: 0; }
.how-it-works__card .how-it-works__desc { margin: 0; font-size: 0.8125rem; }

.how-it-works__step {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--encoding-fix-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.how-it-works__card-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; }
.how-it-works__desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.45; }
.how-it-works__arrow { color: var(--text-muted); font-size: 1.25rem; align-self: center; }

.how-it-works__detail {
  margin-left: -24px;
  margin-right: -24px;
  padding: 24px 24px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.how-it-works__detail-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.how-it-works__detail-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 768px) {
  .how-it-works__detail { margin-left: -16px; margin-right: -16px; padding: 20px 16px 24px; }
  .how-it-works__detail-inner { grid-template-columns: 1fr; gap: 20px; }
}

.how-it-works__detail-media {
  min-height: 200px;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  touch-action: none;
}

.how-it-works__zoom-wrap {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  touch-action: none;
}

.how-it-works__detail-img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.how-it-works__detail-body { min-width: 0; }
.how-it-works__detail-step {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--encoding-fix-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.how-it-works__detail-title { font-size: 1.125rem; font-weight: 600; color: var(--text); margin: 0 0 12px; }
.how-it-works__detail-text { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.6; }
.how-it-works__detail-text p { margin: 0 0 12px; }
.how-it-works__detail-text p:last-child { margin-bottom: 0; }
