/* =====================================================================
   Trang cá nhân & cộng đồng: Hộ chiếu di sản, Địa điểm đã lưu, Đóng góp, Chứng nhận.
   Dùng kèm admin.css (adm-*). Tiền tố cm- để không đụng trang khác.
   ===================================================================== */

/* ---------- Con dấu (triện đỏ) ---------- */
.cm-seal { --c: var(--hk-primary); position: relative; width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--c); display: flex; align-items: center; justify-content: center; color: var(--c); font-family: var(--hk-heading-font, Georgia, serif); font-weight: 700; font-size: 30px; flex-shrink: 0; }
.cm-seal::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px dashed var(--c); opacity: 0.8; }
.cm-seal.is-empty { --c: #cdbfa8; border-style: dashed; font-size: 22px; background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,0.025) 6px 12px); }
.cm-seal.is-empty::after { display: none; }
.cm-seal i { font-size: 26px; }
.cm-seal.is-done { transform: rotate(var(--rot, -6deg)); background: rgba(139, 37, 0, 0.04); }

/* ---------- Hộ chiếu ---------- */
.cm-progress { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cm-progress-num { font-family: var(--hk-heading-font, Georgia, serif); font-size: 40px; font-weight: 700; color: var(--hk-primary); line-height: 1; }
.cm-progress-num small { font-size: 20px; color: var(--hk-muted); }
.cm-progress-main { flex: 1; min-width: 220px; }
.cm-bar { height: 10px; border-radius: 999px; background: #f0e7d8; overflow: hidden; margin-top: 8px; }
.cm-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8B2500, #B8641E); transition: width 0.4s; }

.cm-stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; margin-top: 20px; }
.cm-stop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 14px 8px; border-radius: 14px; color: inherit; transition: background 0.15s; }
.cm-stop:hover { background: var(--hk-paper); }
.cm-stop b { font-size: 14px; line-height: 1.35; color: var(--hk-ink); }
.cm-stop small { font-size: 12px; color: var(--hk-muted); }
.cm-stop.is-done small { color: #1d7a4f; font-weight: 600; }

.cm-cert { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.cm-cert img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--hk-line); box-shadow: 0 8px 24px rgba(44, 30, 22, 0.12); display: block; }
.cm-cert-actions { display: flex; flex-direction: column; gap: 10px; }
.cm-cert-actions .adm-btn { width: 100%; }
.cm-cert-locked { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1.5px dashed var(--hk-line); border-radius: 12px; background: var(--hk-paper); color: var(--hk-muted); font-size: 14px; }
.cm-cert-locked i { font-size: 28px; color: #cdbfa8; }

.cm-mini-stamps { display: flex; flex-wrap: wrap; gap: 14px; }
.cm-mini-stamp { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--hk-line); border-radius: 999px; background: #fff; color: var(--hk-ink); font-size: 13px; font-weight: 600; }
.cm-mini-stamp .cm-seal { width: 34px; height: 34px; font-size: 13px; border-width: 2px; }
.cm-mini-stamp .cm-seal::after { inset: 3px; border-width: 1px; }

.cm-howto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cm-howto div { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--hk-muted); line-height: 1.5; }
.cm-howto b { display: block; color: var(--hk-ink); font-size: 14px; }
.cm-howto i { width: 34px; height: 34px; border-radius: 10px; background: #fbf1ec; color: var(--hk-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Thẻ địa điểm / ký ức ---------- */
.cm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cm-card { background: #fff; border: 1px solid var(--hk-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s, opacity 0.2s; }
.cm-card:hover { box-shadow: 0 6px 18px rgba(44, 30, 22, 0.08); }
.cm-card-img { aspect-ratio: 16 / 9; background: var(--hk-paper) center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #cdbfa8; font-size: 30px; position: relative; }
.cm-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cm-card-title { font-family: var(--hk-heading-font, Georgia, serif); font-weight: 700; font-size: 17px; color: var(--hk-ink); line-height: 1.3; }
.cm-card-meta { font-size: 13px; color: var(--hk-muted); display: flex; gap: 6px; align-items: flex-start; }
.cm-card-meta i { width: 14px; margin-top: 3px; color: var(--hk-primary); text-align: center; }
.cm-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.cm-card-actions .adm-btn { flex: 1; }
.cm-fest { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #fff8ec; border: 1px solid #f1d9ab; font-size: 12px; color: #6b4a00; }
.cm-fest b { color: #5a3d00; }
.cm-heart-on { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.92); color: #d6336c; display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }

.cm-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--hk-line); }
.cm-status { align-self: flex-start; }
.cm-review-note { font-size: 12px; padding: 8px 10px; border-radius: 8px; background: var(--hk-paper); color: var(--hk-muted); border-left: 3px solid var(--hk-line); }

.cm-list { display: flex; flex-direction: column; }
.cm-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid #f1ebe1; }
.cm-row:last-child { border-bottom: none; }
.cm-row-main { flex: 1; min-width: 0; }
.cm-row-title { font-weight: 700; color: var(--hk-ink); }
.cm-row-text { font-size: 14px; color: #4a3b30; margin-top: 4px; white-space: pre-line; word-break: break-word; }
.cm-row-meta { font-size: 12px; color: var(--hk-muted); margin-top: 6px; }

.cm-tabs { display: inline-flex; background: #fff; border: 1px solid var(--hk-line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.cm-tab { padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--hk-muted); display: inline-flex; gap: 8px; align-items: center; }
.cm-tab:hover { color: var(--hk-primary); }
.cm-tab.is-active { background: var(--hk-primary); color: #fff; }
.cm-tab .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #d9a441; color: #2c1e16; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.cm-tab.is-active .n { background: rgba(255,255,255,0.25); color: #fff; }

.cm-empty-cta { text-align: center; padding: 40px 20px; color: var(--hk-muted); }
.cm-empty-cta i { font-size: 36px; color: var(--hk-line); display: block; margin-bottom: 12px; }
.cm-empty-cta b { display: block; color: var(--hk-ink); font-size: 16px; margin-bottom: 6px; }

/* Duyệt ký ức (admin) */
.cm-mod { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 18px; border-bottom: 1px solid #f1ebe1; }
.cm-mod:last-child { border-bottom: none; }
.cm-mod-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; align-content: start; }
.cm-mod-photos a:first-child { grid-column: span 2; }
.cm-mod-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--hk-line); display: block; }
.cm-mod-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.cm-mod-actions form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.cm-mod-actions .adm-input { max-width: 320px; min-height: 34px; padding: 6px 10px; font-size: 13px; }
.cm-who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--hk-muted); }
.cm-who img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* Toast nhỏ dùng chung */
.cm-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: #2c1e16; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 9999; transition: 0.25s; pointer-events: none; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.cm-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
    .cm-cert { grid-template-columns: minmax(0, 1fr); }
    .cm-howto { grid-template-columns: minmax(0, 1fr); }
    .cm-stops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-seal { width: 76px; height: 76px; font-size: 26px; }
    .cm-mod { grid-template-columns: minmax(0, 1fr); }
    .cm-row { padding: 12px 14px; }
}

.cm-row-title a, .cm-card-meta a { color: var(--hk-primary); }
.cm-row-title a:hover, .cm-card-meta a:hover { text-decoration: underline; }
