/* 影片輪播樣式 */

/* 橫式video輪播 */
.horizontal-videos-carousel {
    position: relative;
    width: 100%;
    margin: 20px 0;
    overflow: hidden;
}

.horizontal-videos-carousel .swiper-wrapper {
    display: flex;
    align-items: center;
}

.horizontal-videos-carousel .swiper-slide {
    width: 100%;
    height: auto;
}

.horizontal-videos-carousel .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.horizontal-videos-carousel .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Reels直式影片輪播 */
.reels-videos-carousel {
    position: relative;
    width: 100%;
    margin: 20px 0;
    overflow: hidden;
}

.reels-videos-carousel .swiper-wrapper {
    display: flex;
    align-items: center;
}

.reels-videos-carousel .swiper-slide {
    width: 100%;
    height: auto;
}

.reels-videos-carousel .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%; /* 9:16 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reels-videos-carousel .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Swiper 導航按鈕 */
.horizontal-videos-carousel .swiper-button-next,
.horizontal-videos-carousel .swiper-button-prev,
.reels-videos-carousel .swiper-button-next,
.reels-videos-carousel .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.horizontal-videos-carousel .swiper-button-next:hover,
.horizontal-videos-carousel .swiper-button-prev:hover,
.reels-videos-carousel .swiper-button-next:hover,
.reels-videos-carousel .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.horizontal-videos-carousel .swiper-button-next:after,
.horizontal-videos-carousel .swiper-button-prev:after,
.reels-videos-carousel .swiper-button-next:after,
.reels-videos-carousel .swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

/* Swiper 分頁器 */
.horizontal-videos-carousel .swiper-pagination,
.reels-videos-carousel .swiper-pagination {
    position: relative;
    margin-top: 20px;
    display: none; /* 預設隱藏 */
}

/* 平板時顯示分頁器 */
@media (min-width: 768px) and (max-width: 1023px) {
    .horizontal-videos-carousel .swiper-pagination,
    .reels-videos-carousel .swiper-pagination {
        display: block;
        text-align: center;
        padding: 10px 0;
    }
}

/* Bar 樣式分頁器 */
.horizontal-videos-carousel .swiper-pagination-bullet,
.reels-videos-carousel .swiper-pagination-bullet {
    width: 30px;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    opacity: 0.6;
    transition: all 0.3s ease;
    margin: 0 3px;
    display: inline-block;
    cursor: pointer;
}

.horizontal-videos-carousel .swiper-pagination-bullet:hover,
.reels-videos-carousel .swiper-pagination-bullet:hover {
    opacity: 0.8;
    background: #999;
}

.horizontal-videos-carousel .swiper-pagination-bullet-active,
.reels-videos-carousel .swiper-pagination-bullet-active {
    background: #007cba;
    opacity: 1;
    transform: none; /* 移除縮放效果 */
}

.horizontal-videos-carousel .swiper-pagination-bullet-active:hover,
.reels-videos-carousel .swiper-pagination-bullet-active:hover {
    background: #005a87;
}

/* 響應式設計 */
@media (max-width: 768px) {
    /* 手機端樣式調整 */
    .horizontal-videos-carousel,
    .reels-videos-carousel {
        margin: 15px 0;
    }
    
    .horizontal-videos-carousel .video-container,
    .reels-videos-carousel .video-container {
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .horizontal-videos-carousel .swiper-button-next,
    .horizontal-videos-carousel .swiper-button-prev,
    .reels-videos-carousel .swiper-button-next,
    .reels-videos-carousel .swiper-button-prev {
        width: 36px;
        height: 36px;
    }
    
    .horizontal-videos-carousel .swiper-button-next:after,
    .horizontal-videos-carousel .swiper-button-prev:after,
    .reels-videos-carousel .swiper-button-next:after,
    .reels-videos-carousel .swiper-button-prev:after {
        font-size: 14px;
    }
    
    .horizontal-videos-carousel .swiper-pagination,
    .reels-videos-carousel .swiper-pagination {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    /* 小螢幕手機端 */
    .horizontal-videos-carousel,
    .reels-videos-carousel {
        margin: 10px 0;
    }
    
    .horizontal-videos-carousel .swiper-button-next,
    .horizontal-videos-carousel .swiper-button-prev,
    .reels-videos-carousel .swiper-button-next,
    .reels-videos-carousel .swiper-button-prev {
        width: 32px;
        height: 32px;
    }
    
    .horizontal-videos-carousel .swiper-button-next:after,
    .horizontal-videos-carousel .swiper-button-prev:after,
    .reels-videos-carousel .swiper-button-next:after,
    .reels-videos-carousel .swiper-button-prev:after {
        font-size: 12px;
    }
}

/* 載入動畫 */
.horizontal-videos-carousel .swiper-slide,
.reels-videos-carousel .swiper-slide {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 影片容器懸停效果 */
.horizontal-videos-carousel .video-container:hover,
.reels-videos-carousel .video-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* 確保影片響應式 */
.horizontal-videos-carousel .video-container iframe,
.reels-videos-carousel .video-container iframe {
    max-width: 100%;
    max-height: 100%;
}

/* 無障礙訪問 */
.horizontal-videos-carousel .swiper-button-next:focus,
.horizontal-videos-carousel .swiper-button-prev:focus,
.reels-videos-carousel .swiper-button-next:focus,
.reels-videos-carousel .swiper-button-prev:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    .horizontal-videos-carousel .swiper-pagination-bullet,
    .reels-videos-carousel .swiper-pagination-bullet {
        background: #666;
    }
    
    .horizontal-videos-carousel .swiper-pagination-bullet-active,
    .reels-videos-carousel .swiper-pagination-bullet-active {
        background: #4a9eff;
    }
}
