/* Slideshow Component Styles */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 400px; /* 🔥 改用固定高度，避免overflow問題 */
    background: #fff;
    border-radius: 8px;
    overflow: visible; /* 🔥 改為visible，確保內容不會被裁切 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slideshow-slide.active {
    opacity: 1;
}

/* 🔥 新增：slideshow 內容容器 - 左右布局 */
.slideshow-content {
    display: flex;
    height: 100%;
    width: 100%;
}

/* 🔥 新增：左側圖片區域 */
.slideshow-image-section {
    flex: 0 0 60%; /* 圖片佔60%寬度 */
    position: relative;
    height: 100%;
    background-color: black;
}

.slideshow-image-section img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 🔥 修改：標題現在在圖片區域內 */
.slideshow-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 15px 20px;
    backdrop-filter: blur(5px);
}

.slideshow-text h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: bold;
}

/* 🔥 新增：右側文字區域 */
.slideshow-text-section {
    flex: 0 0 40%; /* 文字佔40%寬度 */
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
}

.slideshow-text-content {
    width: 100%;
}

.slideshow-text-content p {
    margin: 0;
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    text-align: justify;
}

.slideshow-timer {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    z-index: 10;
}

.slideshow-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #007bff;
    width: 0%;
    transition: width 0.1s ease;
    z-index: 5;
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.slideshow-nav:hover {
    background: rgba(0,0,0,0.7);
}

.slideshow-nav.prev {
    left: 15px;
}

.slideshow-nav.next {
    right: 15px;
}

.slideshow-container:hover .slideshow-nav {
    opacity: 1;
}

/* 縮圖區域包裝器（包含導航箭頭） */
.slideshow-thumbnails-wrapper {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

/* 縮圖列表容器 */
.slideshow-thumbnails {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 縮圖導航箭頭 */
.slideshow-thumbnail-nav {
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.slideshow-thumbnail-nav:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.slideshow-thumbnail-nav:active {
    transform: scale(0.95);
}

.slideshow-thumbnail-nav.prev {
    margin-right: 5px;
}

.slideshow-thumbnail-nav.next {
    margin-left: 5px;
}

/* 縮圖項目 */
.slideshow-thumbnail {
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    background: #fff;
}

.slideshow-thumbnail:hover {
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.slideshow-thumbnail.active {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.5);
}

.slideshow-thumbnail img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    display: block;
}

/* Hide thumbnails if disabled */
.slideshow-container[data-thumbnails="false"] + .slideshow-thumbnails-wrapper {
    display: none;
}

/* Hide navigation arrows if disabled */
.slideshow-container[data-navigation="false"] .slideshow-nav {
    display: none;
}

/* Hide timer if disabled */
.slideshow-container[data-timer="false"] .slideshow-timer {
    display: none;
}

/* Hide progress bar if disabled */
.slideshow-container[data-progress="false"] .slideshow-progress {
    display: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .slideshow-container {
        height: 350px; /* 🔥 平板版使用固定高度 */
    }
    
    /* 🔥 平板版：調整左右比例 */
    .slideshow-image-section {
        flex: 0 0 55%;
    }
    
    .slideshow-text-section {
        flex: 0 0 45%;
        padding: 15px;
    }
    
    .slideshow-text-content p {
        font-size: 0.9em;
    }
    
    .slideshow-thumbnail img {
        width: 60px;
        height: 45px;
    }
    
    .slideshow-thumbnails {
        gap: 10px;
    }
    
    .slideshow-thumbnail-nav {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .slideshow-container {
        height: 500px; /* 🔥 手機版使用更高的固定高度以容納上下布局 */
    }
    
    /* 🔥 手機版：改為上下布局 */
    .slideshow-content {
        flex-direction: column;
    }
    
    .slideshow-image-section {
        flex: 0 0 60%;
    }
    
    .slideshow-text-section {
        flex: 0 0 40%;
        border-left: none;
        border-top: 1px solid #e9ecef;
        padding: 15px;
    }
    
    .slideshow-text-content p {
        font-size: 0.85em;
        line-height: 1.5;
    }
    
    .slideshow-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .slideshow-thumbnail-nav {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .slideshow-text {
        padding: 10px 15px;
    }
    
    .slideshow-text h3 {
        font-size: 1em;
    }
    
    .slideshow-thumbnail img {
        width: 50px;
        height: 38px;
    }
    
    .slideshow-thumbnails {
        gap: 8px;
    }
}