/* Медиа объявлений (этап 4а): редактор фото, видео в форме, значок «есть видео», плеер */

/* ---------- Редактор фото ---------- */
html.board-cropper-open,
html.board-cropper-open body {
    overflow: hidden;
}

.board-cropper {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 17, 19, .72);
    box-sizing: border-box;
}

.board-cropper[hidden] {
    display: none;
}

.board-cropper__box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 860px;
    max-height: 100%;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.board-cropper__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #ededee;
    color: #1c1c20;
    font-size: 16px;
    font-weight: 700;
}

.board-cropper__close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f3f5;
    color: #1c1c20;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.board-cropper__stage {
    position: relative;
    height: 60vh;
    min-height: 240px;
    background: #171719;
}

.board-cropper__stage img {
    display: block;
    max-width: 100%;
}

.board-cropper__tools,
.board-cropper__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
}

.board-cropper__tools {
    border-bottom: 1px solid #ededee;
}

.board-cropper__actions {
    justify-content: flex-end;
}

.board-cropper__group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.board-cropper__btn {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #d9dce1;
    border-radius: 8px;
    background: #fff;
    color: #1c1c20;
    font-size: 14px;
    cursor: pointer;
}

.board-cropper__btn.is-active {
    border-color: #2b7de9;
    background: #eef5ff;
    color: #1d5fb8;
}

.board-cropper__btn--primary {
    border-color: #e5302f;
    background: #e5302f;
    color: #fff;
    font-weight: 600;
}

.board-cropper__btn:disabled {
    opacity: .6;
    cursor: default;
}

.board-cropper__btn:focus-visible,
.board-cropper__close:focus-visible {
    outline: 2px solid #2b7de9;
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .board-cropper {
        padding: 0;
    }

    .board-cropper__box {
        height: 100%;
        max-width: none;
        border-radius: 0;
    }

    .board-cropper__stage {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    .board-cropper__tools,
    .board-cropper__actions {
        padding: 8px 12px;
    }

    .board-cropper__actions .board-cropper__btn {
        flex: 1 1 0;
    }
}

/* Кнопка «изменить» на миниатюре в dropzone */
.board-dropzone__edit {
    position: absolute;
    z-index: 2;
    right: 6px;
    bottom: 22px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(20, 20, 22, .72);
    color: #fff;
    font-size: 13px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
}

.board-dropzone__item:not(:first-child) .board-dropzone__edit {
    bottom: 6px;
}

/* ---------- Видео в форме ---------- */
.board-video-tabs {
    display: inline-flex;
    gap: 2px;
    margin: 0 0 10px;
    padding: 3px;
    border-radius: 10px;
    background: #f0f0f2;
}

.board-create-page .board-form .board-video-tabs label {
    display: block;
    margin: 0 !important;
    padding: 7px 14px;
    border-radius: 7px;
    color: #55555a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.board-create-page .board-form .board-video-tabs input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.board-create-page .board-form .board-video-tabs label.is-active {
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 20, 22, .12);
    color: #1b1b1d;
}

.board-create-page .board-form .board-video-tabs label:focus-within {
    outline: 2px solid #00a651;
    outline-offset: 1px;
}

.board-video-current {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e4e4e6;
    border-radius: 8px;
    background: #fafafa;
    color: #1c1c20;
    font-size: 13px;
}

.board-video-current img {
    width: 96px;
    height: 54px;
    border-radius: 4px;
    object-fit: cover;
    background: #171719;
}

.board-video-current label {
    margin: 0 !important;
    font-weight: 400;
    color: #8b919a;
}

/* ---------- Значок «есть видео» на карточках ---------- */
.board-video-badge {
    position: absolute;
    z-index: 3;
    /* справа: слева внизу стоит «Срочно» (board-promo.css), справа вверху — состояние */
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 7px;
    border-radius: 20px;
    background: rgba(20, 20, 22, .78);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    pointer-events: none;
}

.board-video-badge::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 7px solid #fff;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* ---------- Плеер на странице объявления ---------- */
.board-video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 8px;
    overflow: hidden;
    background: #171719;
}

.board-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.board-video-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
    border-radius: 8px;
    background: #171719 center / cover no-repeat;
    color: #fff;
    font-size: 15px;
    text-align: center;
}

.board-video-pending[hidden] {
    display: none;
}

.board-video-pending span {
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(20, 20, 22, .78);
}

.board-video-note {
    margin-top: 6px;
    color: #8b919a;
    font-size: 12px;
}

/* Подсказка названия в форме подачи */
.board-title-assist {
    margin: -6px 0 16px;
    padding: 12px 14px;
    background: #fff8e6;
    border: 1px solid #f2dfae;
    border-radius: 10px;
    color: #1c1c20;
    font-size: 14px;
    line-height: 1.4;
}

.board-title-assist[hidden] {
    display: none;
}

.board-title-assist__reason {
    margin-top: 4px;
    color: #6b6b73;
    font-size: 13px;
}

.board-title-assist__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.board-title-assist__apply,
.board-title-assist__keep {
    padding: 6px 14px;
    border: 1px solid #d9d9dc;
    border-radius: 8px;
    background: #fff;
    color: #1c1c20;
    font-size: 13px;
    cursor: pointer;
}

.board-title-assist__apply {
    border-color: #1c1c20;
    background: #1c1c20;
    color: #fff;
}
