/* ============================================================
   Nexus Messenger — Chat Media Gallery (Patch 02, v1.29.20)
   Дополняет существующие .nx-gp-media-* классы (chat-ui.css).
   ============================================================ */

.nx-cm-subpage { display: flex; flex-direction: column; gap: 10px; }

.nx-cm-grid.images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 6px;
}
.nx-cm-grid.list { display: flex; flex-direction: column; gap: 8px; }

.nx-cm-card { position: relative; display: block; }
.nx-cm-card video,
.nx-cm-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-input, rgba(255, 255, 255, 0.04));
    display: block;
}
.nx-cm-dur {
    position: absolute;
    right: 6px;
    bottom: 6px;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
}

.nx-cm-row {
    align-items: center;
    gap: 10px;
}
.nx-cm-row audio { width: 100%; margin-top: 6px; height: 34px; }

.nx-cm-link .nx-cm-linkurl {
    display: block;
    color: var(--accent, #6ea8fe);
    text-decoration: none;
    word-break: break-all;
    font-size: 13px;
    line-height: 1.4;
}
.nx-cm-link .nx-cm-linkurl:hover { text-decoration: underline; }

.nx-cm-status {
    text-align: center;
    color: var(--text-secondary, #9aa0aa);
    font-size: 13px;
    padding: 10px 0;
}
.nx-cm-more {
    display: block;
    margin: 8px auto;
    padding: 8px 18px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-primary, #e9e9ee);
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
}
.nx-cm-more:hover { background: var(--bg-hover-strong, rgba(255, 255, 255, 0.12)); }

/* — бейдж-счётчик на плитках профиля — */
.nx-gp-tile { position: relative; }
.nx-cm-badge {
    position: absolute;
    top: 5px;
    right: 7px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    font-size: 10px;
    line-height: 16px;
    font-weight: 700;
    text-align: center;
    border-radius: 8px;
    background: var(--accent, #4f7cff);
    color: #fff;
}

/* — встроенный видео-просмотрщик — */
.nx-cm-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 13000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.9);
    animation: nx-cm-fade 0.18s ease;
}
@keyframes nx-cm-fade { from { opacity: 0; } to { opacity: 1; } }
.nx-cm-video-el {
    max-width: 92vw;
    max-height: 80vh;
    border-radius: 12px;
    background: #000;
}
.nx-cm-video-title { color: #ddd; font-size: 14px; max-width: 90vw; text-align: center; }
.nx-cm-video-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
.nx-cm-video-close:hover { background: rgba(255, 255, 255, 0.22); }
