/* ============================================================
   제작 정보 (crafts) — 2컬럼 프리미엄 터미널 디자인
   prefix: cr-
   ============================================================ */

/* ── 헤더 ──────────────────────── */
.cr-page-header { padding: 24px 20px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border-secondary); }
.cr-title { font-size: 20px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin: 0; }
.cr-title i { color: var(--color-accent); font-size: 22px; }
.cr-subtitle { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

/* ── 안내 ──────────────────────── */
.cr-notice { padding: 10px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border-secondary); font-size: 12px; color: var(--text-muted); }
.cr-notice p { margin: 0; }

/* ── 검색 ──────────────────────── */
.cr-search-bar { display: flex; gap: 8px; padding: 12px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border-secondary); align-items: center; }
.cr-search-input { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border-secondary); border-radius: 6px; padding: 8px 12px; }
.cr-search-input i { color: var(--text-muted); font-size: 16px; }
.cr-search-input input { flex: 1; border: none; outline: none; background: transparent; color: var(--text-primary); font-size: 13px; font-family: var(--font-ui); }
.cr-search-input input::placeholder { color: var(--text-muted); }
.cr-search-btn { padding: 8px 18px; background: var(--color-accent); color: var(--bg-body); border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.cr-search-btn:hover { opacity: .85; }
.cr-search-reset { font-size: 12px; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.cr-search-reset:hover { color: var(--text-primary); }

/* ── 2컬럼 메인 ──────────────────── */
.cr-main { display: flex; min-height: 600px; }

/* ── 사이드바 ──────────────────── */
.cr-sidebar { width: 280px; flex-shrink: 0; border-right: 1px solid var(--border-secondary); background: var(--bg-surface); display: flex; flex-direction: column; }
.cr-sidebar-header { padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-secondary); letter-spacing: -0.3px; }
.cr-count { color: var(--color-accent); font-weight: 700; }
.cr-sidebar-list { flex: 1; overflow-y: auto; max-height: calc(100vh - 280px); }
.cr-sidebar-list::-webkit-scrollbar { width: 4px; }
.cr-sidebar-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.cr-sidebar-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

.cr-sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.03); transition: all .15s; cursor: pointer; }
.cr-sidebar-item:hover { background: rgba(255,255,255,0.03); }
.cr-sidebar-item.active { background: rgba(240,185,11,0.06); border-left: 3px solid var(--color-accent); }
.cr-sidebar-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); border-radius: 6px; color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.cr-sidebar-item.active .cr-sidebar-icon { color: var(--color-accent); background: rgba(240,185,11,0.1); }
.cr-sidebar-info { min-width: 0; }
.cr-sidebar-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-sidebar-item.active .cr-sidebar-name { color: var(--color-accent); }
.cr-sidebar-meta { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 상세 영역 ──────────────────── */
.cr-detail { flex: 1; min-width: 0; overflow-y: auto; max-height: calc(100vh - 200px); }

.cr-section-block { padding: 20px; border-bottom: 1px solid var(--border-secondary); }
.cr-section-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border-secondary); letter-spacing: -0.3px; }
.cr-section-desc { font-size: 12px; color: var(--text-muted); margin: -8px 0 14px; }

/* ── 최종 제작 정보 ──────────────── */
.cr-final-info { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }

.cr-npc-area { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-elevated); border-radius: 10px; border: 1px solid var(--border-secondary); min-width: 200px; }
.cr-npc-avatar { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: rgba(240,185,11,0.08); border-radius: 50%; color: var(--color-accent); font-size: 28px; flex-shrink: 0; }
.cr-npc-tags { display: flex; flex-direction: column; gap: 4px; }
.cr-npc-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.cr-npc-loc-tag { display: inline-block; padding: 2px 8px; background: rgba(240,185,11,0.1); color: var(--color-accent); border-radius: 4px; font-size: 11px; font-weight: 600; }

.cr-result-area { flex: 1; min-width: 200px; }
.cr-result-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.cr-result-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-elevated); border-radius: 10px; border: 1px solid var(--border-secondary); }
.cr-result-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: rgba(240,185,11,0.08); border-radius: 8px; color: var(--color-accent); font-size: 22px; }
.cr-result-info { display: flex; flex-direction: column; gap: 2px; }
.cr-result-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cr-result-qty { font-size: 13px; color: var(--color-accent); font-weight: 600; }

/* ── 재료 그리드 ──────────────────── */
.cr-mat-section { margin-top: 4px; }
.cr-mat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.cr-mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cr-mat-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-elevated); border: 1px solid var(--border-secondary); border-radius: 8px; transition: border-color .15s; }
.cr-mat-card:hover { border-color: rgba(255,255,255,0.1); }
.cr-mat-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.04); border-radius: 6px; color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.cr-mat-detail { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cr-mat-name { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-mat-link { font-size: 13px; color: var(--color-accent); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-mat-link:hover { text-decoration: underline; }
.cr-mat-qty { font-size: 12px; font-weight: 700; color: var(--text-primary); }

/* ── 제작 과정 ──────────────────── */
.cr-steps { display: flex; flex-direction: column; gap: 0; }
.cr-step { background: var(--bg-elevated); border: 1px solid var(--border-secondary); border-radius: 10px; overflow: hidden; }
.cr-step-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.cr-step-num { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--color-accent); color: var(--bg-body); border-radius: 50%; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.cr-step-npc { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cr-step-loc { color: var(--text-muted); font-weight: 400; }
.cr-step-result { margin-left: auto; font-size: 13px; color: var(--color-accent); font-weight: 600; }
.cr-step-arrow { text-align: center; padding: 6px 0; color: var(--text-muted); font-size: 18px; }

/* ── 채집 단계 스타일 ──────────────── */
.cr-step--collect { border-color: rgba(34,197,94,0.2); background: rgba(34,197,94,0.03); }
.cr-step-num--collect { background: #16a34a; }
.cr-step-badge { display: inline-flex; align-items: center; padding: 2px 8px; background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; flex-shrink: 0; }
.cr-step-collect-info { display: flex; flex-wrap: wrap; gap: 16px; padding: 8px 16px 10px; font-size: 12px; color: var(--text-muted); border-top: 1px solid rgba(34,197,94,0.08); background: rgba(34,197,94,0.02); }
.cr-step-collect-info b { color: var(--text-primary); font-weight: 600; }

.cr-step-mats { padding: 0 16px 12px; }
.cr-step-mats-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.cr-step-mat { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 13px; }
.cr-step-mat:last-child { border-bottom: none; }
.cr-step-mat-name { color: var(--text-secondary); }
.cr-step-mat-qty { color: var(--text-primary); font-weight: 600; }

/* ── 재료 획득처 ──────────────────── */
.cr-drop-list { display: flex; flex-direction: column; gap: 6px; }
.cr-drop-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.cr-drop-row:last-child { border-bottom: none; }
.cr-drop-item { font-size: 13px; font-weight: 600; color: var(--text-primary); min-width: 120px; flex-shrink: 0; }
.cr-drop-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-drop-monster { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: rgba(255,255,255,0.04); border-radius: 4px; font-size: 12px; color: var(--text-secondary); text-decoration: none; transition: all .15s; }
.cr-drop-monster i { color: var(--color-accent); font-size: 13px; }
.cr-drop-monster:hover { background: rgba(240,185,11,0.08); color: var(--color-accent); }
.cr-drop-loc { color: var(--text-muted); }
.cr-drop-none { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ── 빈 상태 ──────────────────────── */
.cr-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; color: var(--text-muted); }
.cr-empty i { font-size: 48px; opacity: .3; margin-bottom: 12px; }
.cr-empty p { font-size: 14px; margin: 0; }

/* ── 이미지 스타일 ──────────────────── */
.cr-sidebar-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.cr-npc-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cr-npc-avatar { overflow: hidden; }
.cr-result-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.cr-mat-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.cr-step-npc-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border-secondary); }
.cr-step-result-icon { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; margin-right: 2px; }
.cr-step-result { display: flex; align-items: center; }

/* ── 모바일 반응형 ──────────────────── */
@media (max-width: 767px) {
  .cr-main { flex-direction: column; }
  .cr-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-secondary); }
  .cr-sidebar-list { max-height: 200px; }
  .cr-detail { max-height: none; }
  .cr-final-info { flex-direction: column; }
  .cr-mat-grid { grid-template-columns: 1fr; }
  .cr-step-header { flex-direction: column; align-items: flex-start; }
  .cr-step-result { margin-left: 0; }
  .cr-drop-row { flex-direction: column; gap: 4px; }
  .cr-drop-item { min-width: auto; }
}
