/* Video Scroller Styles */
#video_scroller {
    background-color: #FFFFFF;
    position: relative;
    overflow: hidden;
    padding: 0 0 30px 0;
    max-width: 100%;
    box-sizing: border-box;
}

#video_scroller .video-scroller-viewport {
    overflow: hidden;
}

#video_scroller .video-scroller-viewport::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background-color: gray;
}

#video_scroller .video-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
    padding-bottom: 10px;
}

#video_scroller .video-card {
    flex: 0 0 auto;
    width: 19%;
    margin-left: 5px;
    margin-right: 5px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

#video_scroller .video-cover {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background-color: #f0f0f0;
}

#video_scroller .video-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

#video_scroller .video-card:hover .video-cover img {
    transform: scale(1.05);
}

#video_scroller .play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#video_scroller .video-card:hover .play-button-overlay {
    opacity: 1;
}

#video_scroller .play-button-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: transform 0.3s;
}

#video_scroller .video-title {
    padding: 12px 10px;
    text-align: center;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    flex-grow: 1;
}

#video_scroller .scroller-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

#video_scroller .nav-button {
    background: rgba(255, 255, 255, 0.9); /* Slightly increase opacity */
    color: #333;
    border: 1px solid #007bff; /* 蓝色边框 */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid; /* 用grid保证内容居中且不影响SVG显示 */
    place-items: center; /* 水平垂直居中 */
    cursor: pointer;
    opacity: 1; /* Ensure full visibility */
    z-index: 10; /* Ensure it is above other elements */
    transition: opacity 0.3s, background-color 0.3s, color 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 0 10px;
    position: relative; /* 确保z-index生效 */
    overflow: visible;  /* 防止SVG被裁剪 */
    padding: 0; /* 关键：去除padding，防止撑大按钮 */
    line-height: 1; /* 关键：防止内容撑高 */
}

#video_scroller .nav-button:hover {
    opacity: 1; /* Ensure hover state does not hide arrows */
    background: #fff;
    color: #000;
}

#video_scroller_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

#video_scroller_modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background: #000;
}

#video_scroller_modal .modal-content .video-aspect-ratio {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

#video_scroller_modal .video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#video_scroller_modal .close-button {
    position: absolute;
    top: -35px;
    right: -5px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 767px) {
    #video_scroller .video-card {
        width: calc(50% - 10px); /* 两边各5px */
        margin-left: 5px;
        margin-right: 5px;
    }
    #video_scroller .video-container {
        padding-bottom: 8px;
    }
}
