/* Bull Video - Front Styles */

.bm-video-section {
    margin: 20px 0;
}

.bm-video-section__title {
    font-size: 1.2em;
    margin-bottom: 15px;
}

/* Thumbnail Grid */
.bm-video-section__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.bm-video-section__item {
    max-width: 88px;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bm-video-section__item:hover,
.bm-video-section__item:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    outline: none;
}

/* Thumbnail with 16:9 aspect ratio */
.bm-video-section__thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #222;
}

.bm-video-section__thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Upload placeholder (no thumbnail) */
.bm-video-section__placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    background: #333;
}

/* Play button overlay */
.bm-video-section__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    color: #fff;
    transition: background 0.2s ease;
    pointer-events: none;
}

.bm-video-section__item:hover .bm-video-section__play-btn {
    background: rgba(200, 0, 0, 0.85);
}

/* Video title */
.bm-video-section__info {
    padding: 8px 10px;
}

.bm-video-section__name {
    font-size: 0.9em;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal (Popover API — renders in top layer, above all stacking contexts) */
.bm-video-modal {
    border: none;
    background: transparent;
    padding: 0;
    max-width: 900px;
    width: min(90%, 900px);
    inset: 0;
    margin: auto;
    position: fixed;
}

.bm-video-modal:popover-open {
    display: block;
}

.bm-video-modal::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

.bm-video-modal__content {
    position: relative;
    width: 100%;
}

.bm-video-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    z-index: 2;
}

.bm-video-modal__close:hover {
    color: #ccc;
}

.bm-video-modal__player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.bm-video-modal__player iframe,
.bm-video-modal__player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive */
@media (max-width: 576px) {
    .bm-video-section__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .bm-video-modal {
        width: 95%;
    }

    .bm-video-modal__close {
        top: -35px;
        font-size: 28px;
    }
}
