/* /assets/css/review.css
 * 법원 제출용 문서 정리 페이지 스타일
 */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --line: #e7ebf3;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --soft: #f1f5ff;
  --shadow: 0 10px 30px rgba(15,23,42,0.06);
  --radius: 14px;
  --green: #22c55e;
  --red: #ef4444;
}

*,*::before,*::after { box-sizing: border-box; }

html {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ====== 헤더 ====== */
.rv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.rv-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rv-logo {
  height: 28px;
  display: block;
}

.rv-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.rv-header-nav {
  display: flex;
  gap: 10px;
}

.rv-nav-link {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: background 0.15s;
}

.rv-nav-link:hover {
  background: var(--soft);
}

/* ====== 메인 ====== */
.rv-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.rv-card {
  width: 100%;
  max-width: 800px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ====== 탭 선택 ====== */
.rv-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.rv-tab {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.rv-tab:hover {
  color: var(--text);
}

.rv-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

/* ====== 섹션 공통 ====== */
.rv-section {
  display: none;
  padding: 32px 28px;
}

.rv-section.visible {
  display: block;
}

.rv-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.rv-section-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

/* ====== 드래그앤드롭 업로드 영역 ====== */
.rv-dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.rv-dropzone:hover,
.rv-dropzone.drag-over {
  border-color: var(--blue);
  background: var(--soft);
}

.rv-dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--blue);
}

.rv-dropzone-text {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px;
}

.rv-dropzone-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.rv-file-input {
  display: none;
}

/* ====== 선택된 파일 정보 ====== */
.rv-file-info {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 16px;
}

.rv-file-info.visible {
  display: flex;
}

.rv-file-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.rv-file-detail {
  flex: 1;
  min-width: 0;
}

.rv-file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rv-file-size {
  font-size: 12px;
  color: var(--muted);
}

.rv-file-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
}

.rv-file-remove:hover {
  color: var(--red);
}

/* ====== 텍스트 입력 영역 ====== */
.rv-textarea {
  width: 100%;
  min-height: 240px;
  max-height: 480px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  resize: vertical;
  transition: border-color 0.15s;
}

.rv-textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.rv-textarea::placeholder {
  color: #94a3b8;
}

.rv-text-count {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ====== 제출 버튼 ====== */
.rv-submit-wrap {
  margin-top: 20px;
}

.rv-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.rv-submit:hover {
  background: var(--blue2);
}

.rv-submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* ====== 처리 중 (프로그레스) ====== */
.rv-progress-title {
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 16px;
}

.rv-progress-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.rv-progress-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.rv-progress-mark {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
}

.rv-mark-done {
  color: var(--green);
  font-weight: 700;
}

.rv-mark-pending {
  opacity: 0.4;
}

@keyframes rvSpin {
  to { transform: rotate(360deg); }
}

.rv-spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: text-top;
  animation: rvSpin 1s linear infinite;
}

/* ====== 결과 ====== */
.rv-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.rv-result-title {
  font-size: 18px;
  font-weight: 700;
}

.rv-result-actions {
  display: flex;
  gap: 8px;
}

.rv-btn-outline {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rv-btn-outline:hover {
  background: var(--soft);
  border-color: var(--blue);
}

/* 리치텍스트 (chat.render.js와 동일 패턴) */
.minbly-rt {
  white-space: normal;
  line-height: 1.65;
  word-break: break-word;
  font-size: 14.5px;
}

.minbly-rt .rt-title {
  font-size: 17px;
  font-weight: 600;
  margin: 18px 0 10px;
}

.minbly-rt .rt-title:first-child {
  margin-top: 0;
}

.minbly-rt p {
  margin: 0 0 12px;
}

.minbly-rt p:last-child {
  margin-bottom: 0;
}

.minbly-rt ul {
  margin: 0 0 12px 18px;
  padding: 0;
}

.minbly-rt li {
  margin: 0 0 4px;
}

/* ====== 에러 ====== */
.rv-error-box {
  text-align: center;
  padding: 48px 24px;
}

.rv-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--red);
}

.rv-error-msg {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 20px;
  line-height: 1.6;
}

/* ====== 푸터 ====== */
.rv-footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ====== 복사 완료 토스트 ====== */
.rv-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}

.rv-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ====== 반응형 ====== */
@media (max-width: 640px) {
  .rv-header {
    padding: 10px 14px;
  }

  .rv-header-title {
    font-size: 14px;
  }

  .rv-nav-link {
    font-size: 12px;
    padding: 5px 8px;
  }

  .rv-main {
    padding: 16px 10px;
  }

  .rv-section {
    padding: 24px 16px;
  }

  .rv-section-title {
    font-size: 17px;
  }

  .rv-dropzone {
    padding: 32px 16px;
  }

  .rv-textarea {
    min-height: 180px;
  }

  .rv-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .rv-result-actions {
    width: 100%;
  }

  .rv-btn-outline {
    flex: 1;
    text-align: center;
  }

  .minbly-rt .rt-title {
    font-size: 15px;
  }
}
