/* Медиа объявлений (этап 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-gallery__stage {
    position: relative;
}

.board-gallery__video-btn {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 8px;
    border-radius: 20px;
    background: rgba(20, 20, 22, .78);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    text-decoration: none !important;
    transition: background .15s;
}

.board-gallery__video-btn:hover,
.board-gallery__video-btn:focus-visible {
    background: #00a651;
}

.board-gallery__video-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
}

.board-gallery__video-btn-icon::before {
    content: "";
    margin-left: 2px;
    border-left: 7px solid #1c1c20;
    border-top: 4.5px solid transparent;
    border-bottom: 4.5px solid transparent;
}

.board-gallery__video-btn-time {
    font-weight: 400;
    opacity: .85;
}

.board-gallery__thumb--video,
.board-gallery__main--video {
    position: relative !important;
    background: #171719 !important;
}

.board-gallery__thumb--video img,
.board-gallery__main--video img {
    background: #171719 !important;
    object-fit: cover !important;
    opacity: .85;
}

.board-gallery__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    pointer-events: none;
}

.board-gallery__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -7px 0 0 -4px;
    border-left: 12px solid #1c1c20;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.board-gallery__play--big {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
}

.board-gallery__play--big::before {
    margin: -12px 0 0 -6px;
    border-left-width: 20px;
    border-top-width: 12px;
    border-bottom-width: 12px;
}

.board-gallery__duration {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(20, 20, 22, .78);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    pointer-events: none;
}

.board-gallery__thumb--video:hover .board-gallery__play,
.board-gallery__main--video:hover .board-gallery__play {
    background: #fff;
}

.board-video-pending--popup {
    width: min(640px, 90vw);
    min-height: 300px;
}

@media (max-width: 767px) {
    .board-gallery__video-btn {
        top: 10px;
        right: 10px;
        padding: 5px 10px 5px 6px;
        font-size: 12px;
    }

    .board-gallery__play {
        width: 26px;
        height: 26px;
        margin: -13px 0 0 -13px;
    }

    .board-gallery__play::before {
        margin: -5px 0 0 -3px;
        border-left-width: 9px;
        border-top-width: 5px;
        border-bottom-width: 5px;
    }

    .board-gallery__duration {
        right: 3px;
        bottom: 3px;
        padding: 0 4px;
        font-size: 10px;
    }
}

.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;
}
