/* ============================================================
   MEDIA VIEWER STYLES
   ============================================================ */
.mv-overlay {
    position: fixed;
    inset: 0;
    z-index: 720;
    background: #0B0C10;
    display: flex;
    flex-direction: column;
    color: #fff;
    outline: none;
}

.mv-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: calc(.6rem + env(safe-area-inset-top, 0px)) .75rem .6rem;
    flex-shrink: 0;
    background: linear-gradient(rgba(0,0,0,.45), transparent);
    position: relative;
    z-index: 2;
}

.mv-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mv-icon-btn:active {
    background: rgba(255,255,255,0.22);
}

.mv-header-info {
    flex: 1;
    min-width: 0;
    padding: 0 .3rem;
}

.mv-header-name {
    font-weight: 600;
    font-size: .92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mv-header-time {
    font-size: .72rem;
    color: rgba(255,255,255,.6);
}

.mv-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

.mv-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mv-video {
    max-width: 100%;
    max-height: 100%;
}

.mv-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 1rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mv-nav-prev { left: .6rem; }
.mv-nav-next { right: .6rem; }

@media (max-width: 640px) {
    .mv-nav-btn { display: none !important; }
}

.mv-footer {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .9rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
}

.mv-time-current, .mv-time-total {
    font-size: .74rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255,255,255,.75);
    flex-shrink: 0;
    min-width: 32px;
}

.mv-seek-bar {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.25);
    position: relative;
    cursor: pointer;
}

.mv-seek-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    border-radius: 999px;
    background: #FFB347;
}

/* ---------- Сетка "Показать все медиа" ---------- */
.mv-grid {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}

.mv-grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.mv-grid-item img, .mv-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mv-grid-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.4rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* ---------- Подсветка сообщения при "Показать в чате" ---------- */
@keyframes messageHighlightFlash {
    0%, 100% { box-shadow: none; }
    30% { box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.65); }
}

.message-highlight-flash {
    animation: messageHighlightFlash 1.5s ease;
    border-radius: 12px;
}
