@charset "UTF-8";

.csv-json-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

/* 상단 */
.csv-json-page .utility-top {
  text-align: center;
  padding: 30px 20px 28px;
}

.csv-json-page .utility-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.csv-json-page .utility-title {
  margin: 0;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.csv-json-page .utility-desc {
  max-width: 840px;
  margin: 16px auto 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.8;
}

/* 요약 카드 */
.csv-json-summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.csv-json-summary-item {
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.csv-json-summary-item::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.csv-json-summary-item strong {
  display: block;
  margin-bottom: 7px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.csv-json-summary-item span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

/* 메트릭 */
.csv-json-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.csv-json-metric-card {
  padding: 18px 20px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 34%),
    #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.csv-json-metric-card span {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.csv-json-metric-card strong {
  display: block;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

/* 카드 공통 */
.csv-json-converter-card,
.csv-json-preset-card,
.csv-json-preview-card,
.csv-json-result-card {
  padding: 28px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.csv-json-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.csv-json-card-head h2 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.csv-json-card-head p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.csv-json-head-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 4px;
}

/* 업로드 */
.csv-json-upload-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.csv-json-upload-dropzone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 220px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  border: 2px dashed #d8dee8;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.csv-json-upload-dropzone:hover,
.csv-json-upload-dropzone.is-dragover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.08);
}

.csv-json-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22);
}

.csv-json-upload-dropzone strong {
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.5;
}

.csv-json-upload-dropzone small {
  max-width: 640px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.csv-json-file-summary {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
}

/* 옵션 */
.csv-json-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.csv-json-field {
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: #f8fafc;
}

.csv-json-field .utility-field-label {
  display: block;
  margin-bottom: 10px;
  color: #0f172a;
  font-weight: 900;
}

.csv-json-input {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: 14px;
  font-weight: 700;
}

.csv-json-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.csv-json-field-help {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

/* 토글 */
.csv-json-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.csv-json-toggle-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
}

.csv-json-toggle-card span {
  display: block;
}

.csv-json-toggle-card strong {
  display: block;
  margin-bottom: 6px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.csv-json-toggle-card small {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.csv-json-toggle-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

/* 안내 */
.csv-json-notice-box {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #f8fbff;
}

.csv-json-notice-box strong {
  display: block;
  margin-bottom: 8px;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 900;
}

.csv-json-notice-box p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.8;
}

/* 버튼 */
.csv-json-action-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.csv-json-page .utility-btn {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 800;
}

.csv-json-page .utility-btn-primary {
  background: linear-gradient(135deg, #0f172a, #2563eb);
  border-color: #0f172a;
  color: #ffffff;
}

.csv-json-page .utility-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.18);
}

/* 프리셋 */
.csv-json-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.csv-json-preset {
  width: 100%;
  min-height: 98px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.csv-json-preset:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.csv-json-preset strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.csv-json-preset span {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

/* 상태 배지 */
.csv-json-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.csv-json-status-badge.is-ready {
  color: #475569;
  background: #f1f5f9;
}

.csv-json-status-badge.is-success {
  color: #166534;
  background: #dcfce7;
}

.csv-json-status-badge.is-error {
  color: #991b1b;
  background: #fee2e2;
}

/* 미리보기 */
.csv-json-preview-meta-grid,
.csv-json-result-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.csv-json-preview-meta,
.csv-json-result-meta {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.csv-json-preview-meta span,
.csv-json-result-meta span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.csv-json-preview-meta strong,
.csv-json-result-meta strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.csv-json-preview-table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
}

.csv-json-preview-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.csv-json-preview-table th,
.csv-json-preview-table td {
  padding: 12px 14px;
  border-right: 1px solid #edf1f5;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: top;
  color: #374151;
  font-size: 14px;
  line-height: 1.7;
}

.csv-json-preview-table th {
  background: #f8fafc;
  color: #111827;
  font-weight: 900;
}

.csv-json-preview-table tr:last-child td {
  border-bottom: none;
}

.csv-json-preview-table th:last-child,
.csv-json-preview-table td:last-child {
  border-right: none;
}

.csv-json-empty-state {
  padding: 26px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

/* 결과 */
.csv-json-output {
  width: 100%;
  min-height: 360px;
  max-height: 620px;
  box-sizing: border-box;
  padding: 22px;
  resize: vertical;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  font-family: Consolas, Monaco, "SFMono-Regular", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre;
}

.csv-json-output:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* 도움말 */
.csv-json-page .help-panel {
  margin-top: 30px;
}

.csv-json-page .help-panel > h2 {
  margin: 0 0 18px;
  color: #0f172a;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.csv-json-page .help-box {
  border-radius: 22px;
}

/* 반응형 */
@media (max-width: 960px) {
  .csv-json-summary-card,
  .csv-json-metrics-grid,
  .csv-json-toggle-grid,
  .csv-json-preview-meta-grid,
  .csv-json-result-meta-grid,
  .csv-json-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .csv-json-option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .csv-json-page {
    padding: 0 0 28px;
  }

  .csv-json-page .utility-top {
    padding: 24px 14px 22px;
  }

  .csv-json-summary-card,
  .csv-json-metrics-grid,
  .csv-json-toggle-grid,
  .csv-json-preview-meta-grid,
  .csv-json-result-meta-grid,
  .csv-json-preset-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .csv-json-converter-card,
  .csv-json-preset-card,
  .csv-json-preview-card,
  .csv-json-result-card {
    padding: 22px;
    border-radius: 20px;
  }

  .csv-json-card-head {
    flex-direction: column;
    gap: 14px;
  }

  .csv-json-head-actions,
  .csv-json-action-row {
    width: 100%;
    flex-direction: column;
  }

  .csv-json-head-actions .utility-btn,
  .csv-json-action-row .utility-btn {
    width: 100%;
  }

  .csv-json-upload-dropzone {
    min-height: 180px;
    padding: 22px 16px;
  }

  .csv-json-upload-dropzone strong {
    font-size: 18px;
  }

  .csv-json-preview-table {
    min-width: 640px;
  }

  .csv-json-output {
    min-height: 300px;
    font-size: 13px;
  }

  .csv-json-page .utility-title {
    font-size: 32px;
  }
}