/* ═══════════════════════════════════════════════
   items.css — 아이템 도감 (박스형 카드 레이아웃)
   변신/몬스터 도감과 동일 패턴 — CSS prefix: it-
   ═══════════════════════════════════════════════ */

/* ── 페이지 헤더 ──────────────────────── */
.it-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 21px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-secondary);
}
.it-header-info { display: flex; flex-direction: column; gap: 8px; }
.it-title {
  font-size: 20px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.it-title i { color: var(--color-accent); }
.it-subtitle { font-size: 13px; color: var(--text-muted); }

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

/* ── 대분류 탭 ──────────────────────── */
.it-category-tabs {
  display: flex; gap: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-secondary);
  padding: 0 20px;
}
.it-tab {
  padding: 12px 20px;
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.it-tab:hover { color: var(--text-primary); }
.it-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ── 소분류 필터 (몬스터 도감 서브카테고리 통일) ── */
.it-sub-filters {
  display: flex; gap: 6px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-secondary);
  flex-wrap: wrap;
}
.it-sub {
  padding: 5px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.it-sub:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}
.it-sub.active {
  color: var(--color-accent);
  background: rgba(240, 185, 11, 0.08);
  border-color: rgba(240, 185, 11, 0.3);
  font-weight: 600;
}

/* ── 검색 바 ──────────────────────── */
.it-search-bar {
  display: flex; gap: 8px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-secondary);
}
.it-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: 0 12px;
}
.it-search-input i { color: var(--text-muted); font-size: 16px; }
.it-search-input input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text-primary);
  font-size: 13px; padding: 10px 0;
  font-family: var(--font-ui);
}
.it-search-input input::placeholder { color: var(--text-muted); }
.it-search-btn {
  padding: 0 16px;
  background: var(--color-accent);
  color: var(--bg-body);
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.it-search-btn:hover { opacity: 0.85; }

/* ── 결과 카운트 (기존 호환) ──────────────────────── */
.it-result-count {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  font-size: 12px; color: var(--text-muted);
}
.it-search-tag {
  font-size: 12px;
  color: var(--color-accent);
  margin-left: 12px;
}
.it-search-tag a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 4px;
}
.it-search-tag a:hover { color: var(--color-down); }

/* ── 목록 섹션 ──────────────────────── */
.it-section { padding: 20px 20px; }
.it-section-title {
  padding: 0 0 12px;
  font-size: 14px; font-weight: 300;
  color: var(--text-secondary);
}
.it-count {
  font-family: var(--font-mono);
  color: var(--color-accent);
  margin-left: 8px;
}

/* ── 빈 결과 ──────────────────────── */
.it-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.it-empty i { font-size: 40px; margin-bottom: 12px; display: block; }
.it-empty p { font-size: 14px; }

/* ── 아이템 카드 (박스형) ──────────────────────── */
.it-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: visible;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.it-card:last-child { margin-bottom: 0; }
.it-card:hover {
  border-color: var(--border-primary);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* 카드 헤더 */
.it-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px 10px;
  gap: 12px;
}
.it-card-identity { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.it-card-img {
  width: 60px; height: 60px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.it-card-no-img {
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 28px;
  flex-shrink: 0;
}
.it-card-text { min-width: 0; }
.it-card-name {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.it-card-meta {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 2px;
}

/* 태그 */
.it-card-tags { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }
.it-tag {
  font-size: 11px; padding: 3px 8px;
  border-radius: 4px; font-weight: 500;
  white-space: nowrap;
}
.it-tag.ok { color: var(--color-up); background: rgba(14, 203, 129, 0.15); border: 1px solid rgba(14,203,129,0.25); }
.it-tag.no { color: var(--color-down); background: rgba(246, 70, 93, 0.15); border: 1px solid rgba(246,70,93,0.25); }

/* ── 무게 호버 툴팁 ──────────────────────── */
.it-weight-wrap {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-muted);
  padding-bottom: 1px;
}
.it-weight-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 100;
  min-width: 260px;
  padding: 14px 16px;
  background: rgba(20, 20, 25, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
}
.it-weight-tip::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.12);
}
.it-weight-tip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(20, 20, 25, 0.96);
}
.it-weight-wrap:hover .it-weight-tip {
  display: flex;
  flex-direction: column;
}
.it-weight-tip strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.it-wt-line {
  color: var(--text-secondary);
}
.it-wt-formula {
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  text-align: center;
}

/* 카드 바디 */
.it-card-body { padding: 0 20px 18px; }

/* 스펙 테이블 (변신도감 속도 테이블 패턴) */
.it-spec-wrap {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
}
.it-spec-row {
  display: grid;
}
.it-spec-weapon .it-spec-row,
.it-spec-armor .it-spec-row { grid-template-columns: 1fr 1fr 2fr; }
.it-spec-etc .it-spec-row   { grid-template-columns: 1fr; }

/* 헤더행 */
.it-spec-header {
  background: var(--bg-elevated);
}
.it-spec-header span {
  padding: 8px 12px; text-align: center;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: 0.02em;
}
.it-spec-header span:last-child { border-right: none; }

/* 값행 */
.it-spec-values {
  background: var(--bg-surface);
}
.it-spec-cell {
  padding: 12px 12px; text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
}
.it-spec-cell:last-child { border-right: none; }

/* 옵션 셀 — 좌측 정렬 */
.it-spec-opt {
  text-align: left;
  align-items: flex-start;
  padding: 12px 16px;
}

.it-spec-val {
  font-family: var(--font-mono); font-size: 16px;
  font-weight: 700; color: var(--text-primary);
}
.it-spec-val.accent { color: var(--color-accent); }

.it-option-line {
  display: block;
  font-size: 13px;
  color: var(--color-up);
  line-height: 1.7;
}
.it-option-line strong {
  margin-left: 2px;
  font-weight: 700;
}

/* 착용 클래스 */
.it-equip-class {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.it-equip-class strong {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

/* 부가 정보 — 구분선 */
.it-card-footer {
  margin-top: 14px;
  padding: 0;
}
.it-footer-line {
  font-size: 12px; color: var(--text-secondary);
  line-height: 2.0;
}
.it-footer-line strong {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}
.it-footer-line a {
  color: var(--color-accent);
  text-decoration: none;
}
.it-footer-line a:hover { text-decoration: underline; }

/* ── 페이지네이션 ──────────────────────── */
.it-pagination {
  display: flex; justify-content: center; gap: 4px;
  padding: 20px;
}
.it-page-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.it-page-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.it-page-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--bg-body);
  font-weight: 700;
}

/* ── 모바일 반응형 ──────────────────────── */
@media (max-width: 768px) {
  .it-sub-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 10px 16px;
  }
  .it-sub-filters::-webkit-scrollbar { display: none; }

  .it-section { padding: 16px 12px; }
  .it-section-title { padding: 0 0 10px; }
  .it-card { margin-bottom: 10px; }
  .it-card-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }
  .it-card-tags { margin-top: 8px; }
  .it-card-body { padding: 0 14px 14px; }
  .it-spec-weapon .it-spec-row,
  .it-spec-armor .it-spec-row { grid-template-columns: 1fr 1fr 2fr; }

  .it-search-bar { padding: 10px 16px; }
  .it-category-tabs { padding: 0 16px; }
  .it-result-count { padding: 8px 16px; }
  .it-page-header { padding: 16px; }
  .it-notice { padding: 10px 16px; }
  .it-pagination { padding: 16px 12px; }
}
