/* chat-history modal — flat Stage-themed design (matches proposal-chat-history.html).
   Modal renders OUTSIDE the Stage shell, so colours are hardcoded. */

@keyframes chSpin { to { transform: rotate(360deg); } }
@keyframes chRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.chat-history-modal-content { scrollbar-width: none; -ms-overflow-style: none; }
.chat-history-modal-content::-webkit-scrollbar { display: none; }
#chatHistoryContent { scrollbar-width: none; -ms-overflow-style: none; }
#chatHistoryContent::-webkit-scrollbar { display: none; }

/* ── match rows ── */
.ch-list { display: flex; flex-direction: column; gap: 8px; }
.ch-history-item {
    display: flex; align-items: center; gap: 13px; padding: 11px 13px; cursor: pointer; border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.04);
    transition: transform .16s, border-color .16s, background .16s; animation: chRise .4s ease both;
}
.ch-history-item:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.07); }
.ch-avatar {
    width: 46px; height: 46px; border-radius: 50% !important; object-fit: cover; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.10); transition: border-color .16s;
}
.ch-history-item:hover .ch-avatar { border-color: rgba(255,255,255,0.22); }
.ch-main { flex: 1; min-width: 0; }
.ch-username { color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.ch-username .ch-name-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-badge { width: 15px; height: 15px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 9px; color: #fff; font-weight: bold; }
.ch-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; }
.ch-gender-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 7px; flex: none; }
.ch-gender-badge.male { background: rgba(56,151,240,0.16); color: #7bbcff; }
.ch-gender-badge.female { background: rgba(255,46,104,0.16); color: #ff7aa3; }
.ch-flag { font-size: 14px; line-height: 1; flex: none; }
.ch-time { color: rgba(255,255,255,0.4); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-chev { flex: none; color: rgba(255,255,255,0.4); transition: transform .16s, color .16s; display: inline-flex; }
.ch-chev svg { width: 18px; height: 18px; }
.ch-history-item:hover .ch-chev { color: rgba(255,255,255,0.6); transform: translateX(2px); }

/* ── end-of-history ── */
.ch-end { text-align: center; color: rgba(255,255,255,0.4); font-size: 12px; padding: 16px 0 4px; }

/* ── delete history ── */
.ch-delete { margin-top: 18px; }
.ch-del-btn {
    width: 100%; appearance: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13.5px;
    padding: 13px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.4); transition: .16s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ch-del-btn:hover { background: rgba(255,84,112,0.10); border-color: rgba(255,84,112,0.3); color: #ff5470; }
.ch-del-btn svg { width: 15px; height: 15px; }
.ch-confirm { margin-top: 10px; border-radius: 14px; border: 1px solid rgba(255,84,112,0.28); background: rgba(255,84,112,0.07); padding: 14px; animation: chRise .25s ease both; }
.ch-confirm .t { color: #ff5470; font-size: 13.5px; font-weight: 800; margin-bottom: 3px; }
.ch-confirm .d { color: rgba(255,255,255,0.6); font-size: 12.5px; margin-bottom: 12px; }
.ch-confirm-actions { display: flex; gap: 9px; }
.ch-cbtn { flex: 1; appearance: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 13.5px; padding: 11px; border-radius: 12px; transition: .16s; }
.ch-cancel { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.6); }
.ch-cancel:hover { background: rgba(255,255,255,0.11); color: #fff; }
.ch-del-yes { background: #ff5470; color: #fff; }
.ch-del-yes:hover { filter: brightness(1.08); }

/* ── empty state (also reused for the post-delete "cleared" state) ── */
.ch-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 54px 24px 46px; gap: 16px; animation: chRise .4s ease both; }
.ch-empty-ic { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.6); }
.ch-empty-ic.good { background: rgba(54,211,153,0.12); border-color: rgba(54,211,153,0.28); color: #36d399; }
.ch-empty-ic svg { width: 30px; height: 30px; }
.ch-empty-msg { font-size: 15.5px; font-weight: 700; color: rgba(255,255,255,0.72); }
.ch-empty-sub { font-size: 12.5px; color: rgba(255,255,255,0.4); max-width: 240px; line-height: 1.45; }

/* ── Mobile fullscreen (PRESERVED — same sizing as before) ── */
@media (max-width: 900px) {
    #meetgleChatHistoryModal { padding: 0 !important; }
    #meetgleChatHistoryModal > .chat-history-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100svh !important;
        max-height: 100vh !important;
        max-height: 100svh !important;
        border-radius: 0 !important;
    }
    #chatHistoryContent {
        max-height: calc(100svh - 80px) !important;
    }
}
