/* ================================== */
/* MEDIA PREVIEW MODAL (кастомная версия) */
/* ================================== */

.media-preview-modal {
    width: auto;
    max-width: 90%;
    padding: 0;
    overflow: hidden;
}

.media-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.media-preview-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.media-preview-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.media-preview-close:hover {
    color: var(--text);
}

.media-preview-body {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
    overflow: auto;
}

.media-preview-body img,
.media-preview-body video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}

/* Пагинация */
.media-preview-pagination {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 15;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all var(--transition);
    cursor: pointer;
}

.pagination-dot.active {
    background: var(--primary);
    width: 20px;
    border-radius: 4px;
}

/* Подсветка кнопок при нажатии (активное состояние) */
.ctrl-btn:active {
    transform: scale(0.95);
    background: var(--primary-dark);
}

/* ================================== */
/* СВЕТЛАЯ ТЕМА */
/* ================================== */
body.light-theme .media-preview-header {
    background: var(--bg-surface);
    border-bottom-color: var(--border);
}

body.light-theme .media-preview-title {
    color: var(--text);
}

body.light-theme .media-preview-close {
    color: var(--text-secondary);
}

body.light-theme .media-preview-close:hover {
    color: var(--text);
}

body.light-theme .media-preview-body {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .pagination-dot {
    background: rgba(0, 0, 0, 0.3);
}

body.light-theme .pagination-dot.active {
    background: var(--primary);
}

/* Уважение prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .media-preview-close,
    .pagination-dot,
    .ctrl-btn {
        transition: none;
    }
    .ctrl-btn:active {
        transform: none;
    }
}