/* ================================================
   개인 아이템 기록 (itemrecord.css)
   ================================================ */

body { background-color: #FBFFF1; color: #3C3744; }
.ir-container { max-width: 960px; margin: 0 auto; padding: 0 20px 80px; }

/* 탭 */
.ir-tabs { display: flex; align-items: center; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #B4C5E4; }
.ir-tab { padding: 10px 24px; cursor: pointer; font-weight: 600; font-size: 15px; color: #888; border: none; background: none; border-bottom: 3px solid transparent; transition: all 0.2s; }
.ir-tab.active { color: #3C3744; border-bottom-color: #5A7EC2; }
.ir-tab:hover { color: #3C3744; }
.ir-unlink-btn { margin-left: auto; padding: 0 14px; height: 26px; line-height: 26px; background: #FFEBEE; color: #C62828; border: none; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.ir-unlink-btn:hover { background: #FFCDD2; }

/* 카드 생성 폼 */
.ir-form-wrap { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 28px; }
.ir-form-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #3C3744; display: flex; justify-content: space-between; align-items: center; }
.ir-toggle-btn { background: #8BA7D1; border: none; border-radius: 6px; padding: 4px 12px; font-size: 13px; color: #fff; cursor: pointer; transition: all 0.2s; }
.ir-toggle-btn:hover { background: #7693C0; }
.ir-save-server-btn { background: #8BA7D1; border: none; border-radius: 4px; padding: 2px 8px; font-size: 11px; color: #fff; cursor: pointer; transition: all 0.2s; }
.ir-save-server-btn:hover { background: #7693C0; }
.ir-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.ir-form-group { display: flex; flex-direction: column; }
.ir-form-group.full { grid-column: 1 / -1; }
.ir-form-group label { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #555; }
.ir-form-group input, .ir-form-group select, .ir-form-group textarea {
    padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; background: #FBFFF1; transition: border 0.2s;
}
.ir-form-group input:focus, .ir-form-group select:focus { outline: none; border-color: #5A7EC2; }

.ir-pot-section { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #ddd; grid-column: 1 / -1; }
.ir-pot-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: #5A7EC2; }
.ir-pot-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px 12px; }

.ir-form-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; grid-column: 1 / -1; }
.ir-btn { padding: 9px 22px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.ir-btn-primary { background: #8BA7D1; color: #fff; }
.ir-btn-primary:hover { background: #7693C0; }
.ir-btn-cancel { background: #ddd; color: #555; display: none; }
.ir-btn-cancel:hover { background: #ccc; }

/* 페이지네이션 */
.ir-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; padding: 10px 0; }
.ir-page-btn { min-width: 36px; height: 36px; border: 1px solid #ccc; border-radius: 6px; background: #fff; color: #555; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.ir-page-btn:hover { background: #f0f0f0; border-color: #999; }
.ir-page-btn.active { background: #8BA7D1; color: #fff; border-color: #8BA7D1; }

/* 내 아이템 목록 헤더 */
.ir-my-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ir-my-list-title { font-size: 16px; font-weight: 700; color: #3C3744; }
.ir-my-search-wrap { display: flex; align-items: center; gap: 6px; }
.ir-my-search-input-wrap { position: relative; }
.ir-my-search { padding: 6px 28px 6px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; width: 200px; background: #fff; transition: border 0.2s; }
.ir-my-search:focus { outline: none; border-color: #8BA7D1; }
.ir-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 18px; color: #999; cursor: pointer; padding: 0 4px; line-height: 1; display: none; }
.ir-search-clear:hover { color: #555; }
.ir-my-search-btn { padding: 6px 14px; background: #8BA7D1; color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.ir-my-search-btn:hover { background: #7693C0; }

/* 자동완성 */
.item-name-wrap { position: relative; }
#itemSuggestions { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ccc; border-top: none; border-radius: 0 0 6px 6px; max-height: 200px; overflow-y: auto; z-index: 100; }
.suggestion-item { padding: 8px 10px; cursor: pointer; font-size: 13px; }
.suggestion-item:hover { background: #EEF2FA; }

/* 카드 목록 */
.card-item { background: #fff; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.06); margin-bottom: 12px; overflow: hidden; transition: box-shadow 0.2s; }
.card-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.card-item.card-open { box-shadow: 0 3px 16px rgba(0,0,0,0.12); }

.card-summary { padding: 14px 16px; cursor: pointer; }
.card-main-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.card-server { background: #EEF2FA; color: #5A7EC2; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.card-name { font-size: 15px; font-weight: 700; color: #3C3744; }
.card-part { background: #F0F0F0; padding: 1px 6px; border-radius: 3px; font-size: 12px; color: #666; }
.card-level { font-size: 12px; color: #888; }
.card-nickname { font-size: 12px; color: #888; margin-left: auto; }
.card-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.status-selling { background: #E8F5E9; color: #2E7D32; }
.status-sold { background: #FFF3E0; color: #E65100; }

.card-sub-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.pot-badge { padding: 1px 5px; border-radius: 3px; font-weight: 600; font-size: 11px; }
.grade-legendary { background: #E8F5E9; color: #1B5E20; }
.grade-unique { background: #FFF8E1; color: #F57F17; }
.grade-epic { background: #EDE7F6; color: #6A1B9A; }
.grade-rare { background: #E3F2FD; color: #1565C0; }
.card-price-count { color: #888; }
.card-latest-price { font-weight: 700; color: #D84315; }
.card-recommend { color: #888; margin-left: auto; }
.card-recommend.recommended { color: #1565C0; font-weight: 600; }

/* 카드 상세 */
.card-detail { padding: 0 16px 16px; border-top: 1px solid #f0f0f0; }
.detail-options { padding: 12px 0; }
.pot-detail { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; flex-wrap: wrap; }
.pot-label { font-weight: 700; color: #555; }
.pot-line { color: #666; }
.pot-line::before { content: "·"; margin-right: 2px; color: #bbb; }
.detail-memo { font-size: 12px; color: #888; margin-top: 6px; padding: 6px 8px; background: #FAFAFA; border-radius: 4px; }

/* 차트 */
.detail-chart-wrap { height: 220px; margin: 12px 0; }

/* 가격 추가 폼 */
.price-add-form { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.price-add-form input { padding: 7px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; background: #FBFFF1; }
.price-add-form input[type="number"] { width: 140px; }
.price-add-form input[type="text"] { flex: 1; min-width: 100px; }

/* 가격 테이블 */
.price-table-wrap { max-height: 300px; overflow-y: auto; margin: 8px 0; }
.price-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.price-table th { background: #EEF2FA; color: #3C3744; padding: 8px 10px; text-align: left; position: sticky; top: 0; }
.price-table td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; }
.price-cell { font-weight: 600; color: #D84315; }

/* 카드 액션 */
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid #f0f0f0; margin-top: 8px; }
.btn-sm { padding: 4px 10px; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
.btn-edit { background: #E3F2FD; color: #1565C0; }
.btn-edit:hover { background: #BBDEFB; }
.btn-delete { background: #FFEBEE; color: #C62828; }
.btn-delete:hover { background: #FFCDD2; }
.btn-share { background: #E8F5E9; color: #2E7D32; }
.btn-share:hover { background: #C8E6C9; }
.btn-unshare { background: #FFF3E0; color: #E65100; }
.btn-copy { background: #EDE7F6; color: #6A1B9A; }
.btn-anon { background: #F3E5F5; color: #7B1FA2; }
.btn-anon:hover { background: #E1BEE7; }
.btn-anon-active { background: #7B1FA2; color: #fff; }
.btn-anon-active:hover { background: #6A1B9A; }
.btn-recommend { background: #E3F2FD; color: #1565C0; }
.btn-recommended { background: #1565C0; color: #fff; }

/* 공개 기록 필터 */
.ir-filter-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.ir-filter-bar select, .ir-filter-bar input { padding: 7px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; background: #fff; }
.ir-filter-bar input { flex: 1; min-width: 150px; }
.ir-filter-btn { padding: 7px 16px; background: #8BA7D1; color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* 공개 페이지네이션 */
.page-btn { padding: 6px 12px; margin: 0 2px; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; }
.page-btn.active { background: #5A7EC2; color: #fff; border-color: #5A7EC2; }
#publicPagination { text-align: center; margin-top: 16px; }

/* 모달 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: #fff; border-radius: 12px; padding: 24px; max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.modal-nickname { font-size: 12px; color: #888; margin-left: auto; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #888; padding: 0 4px; margin-left: 8px; }

.empty-msg { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }

/* 비연동 안내 */
.ir-unlinked { text-align: center; padding: 50px 20px; background: #fff; border-radius: 16px; border: 1px solid #B4C5E4; box-shadow: 0 10px 30px rgba(0,0,0,0.03); }
.ir-unlinked h2 { font-size: 20px; margin-bottom: 10px; color: #3C3744; font-weight: 700; }
.ir-unlinked p { font-size: 14px; color: #888; margin-bottom: 24px; line-height: 1.6; }
.ir-sync-btn { background: none; border: 1px solid #B4C5E4; color: #5A7EC2; padding: 10px 28px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.ir-sync-btn:hover { background: #e8f0fb; }

/* 가이드 링크 */
.ir-guide-link { display: inline-block; padding: 8px 20px; background: white; color: #3C3744; border: 1px solid #B4C5E4; border-radius: 30px; font-weight: 700; font-size: 13px; text-decoration: none; transition: all 0.2s; }
.ir-guide-link:hover { background: #e8f0fb; }

.public-card { cursor: pointer; }

/* 모바일 */
@media (max-width: 600px) {
    .ir-form-grid { grid-template-columns: 1fr; }
    .ir-pot-grid { grid-template-columns: 1fr 1fr; }
    .ir-tab { padding: 8px 14px; font-size: 13px; }
    .ir-filter-bar { flex-direction: column; }
    .ir-filter-bar input { min-width: 0; width: 100%; }
    .price-add-form { flex-direction: column; }
    .price-add-form input[type="number"] { width: 100%; }
    .modal-content { padding: 16px; }
}
