/* ==========================================
   時段背景遮罩變化（與首頁相同）
   ========================================== */

/* Morning theme (6:00-12:00) */
body.time-period-morning .background-overlay {
    --overlay-color: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.15), 
        rgba(255, 140, 0, 0.25)
    ) !important;
    background: var(--overlay-color) !important;
}

/* Afternoon theme (12:00-17:00) */
body.time-period-afternoon .background-overlay {
    --overlay-color: linear-gradient(135deg, 
        rgba(255, 140, 66, 0.15), 
        rgba(255, 69, 0, 0.25)
    ) !important;
    background: var(--overlay-color) !important;
}

/* Evening theme (17:00-20:00) */
body.time-period-evening .background-overlay {
    --overlay-color: linear-gradient(135deg, 
        rgba(255, 107, 107, 0.2), 
        rgba(220, 20, 60, 0.3)
    ) !important;
    background: var(--overlay-color) !important;
}

/* Night theme (20:00-00:00) */
body.time-period-night .background-overlay {
    --overlay-color: linear-gradient(135deg, 
        rgba(78, 205, 196, 0.15), 
        rgba(64, 224, 208, 0.25)
    ) !important;
    background: var(--overlay-color) !important;
}

/* Midnight theme (00:00-06:00) */
body.time-period-midnight .background-overlay {
    --overlay-color: linear-gradient(135deg, 
        rgba(155, 89, 182, 0.2), 
        rgba(142, 68, 173, 0.3)
    ) !important;
    background: var(--overlay-color) !important;
}

/* 預設背景遮罩（當沒有時段類別時） */
body:not([class*="time-period-"]) .background-overlay {
    --overlay-color: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.3), 
        rgba(0, 0, 0, 0.5)
    ) !important;
    background: var(--overlay-color) !important;
}/*
 * 四個主分頁通用樣式
 * 滿版背景 + 浮動 Tab 導航
 */

/* ==========================================
   滿版背景區塊
   ========================================== */

.fullscreen-background-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
}

.background-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.background-image,
.background-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.background-video {
    pointer-events: none;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    background: rgba(49, 54, 50, 0.3);
}

/* ==========================================
   浮動 Tab 導航 - 右下方
   ========================================== */

.floating-nav-tabs {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 15px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-width: 300px;
    max-width: 400px;
}

.floating-nav-tabs:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.tabs-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.nav-tab {
    background: transparent;
    border: none;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.nav-tab:hover {
    background: rgba(49, 54, 50, 0.1);
    color: #000;
}

.nav-tab.active {
    background: rgba(49, 54, 50, 0.9);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(49, 54, 50, 0.3);
}

/* 切換按鈕 */
.tabs-toggle {
    background: rgba(49, 54, 50, 0.1);
    border: none;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-left: auto;
}

.tabs-toggle:hover {
    background: rgba(49, 54, 50, 0.2);
    color: #333;
    transform: scale(1.1);
}

/* 進度指示器 */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #888;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(49, 54, 50, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
    border-radius: 2px;
    width: 25%;
    transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-info {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 500;
    min-width: 35px;
}

.current-section {
    color: #4ecdc4;
    font-weight: 600;
}

/* ==========================================
   收合狀態 - 修復收合功能
   ========================================== */

.floating-nav-tabs.collapsed .tabs-container {
    display: none;
}

.floating-nav-tabs.collapsed .progress-indicator {
    margin-top: 0;
}

.floating-nav-tabs.collapsed {
    min-width: auto;
    padding: 15px;
    max-width: 60px;
    transition: all 0.3s ease;
}

/* 確保切換按鈕始終可見 */
.floating-nav-tabs .tabs-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==========================================
   不同頁面的主題色彩
   ========================================== */

/* 探索吟遊 - 統一主題色 */
.explore-yinyou-page .progress-fill {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
}

.explore-yinyou-page .current-section {
    color: #C0A98D;
}

.explore-yinyou-page .nav-tab.active {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
    color: white;
}

/* The One Sense - 統一主題色 */
.theone-sense-page .progress-fill {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
}

.theone-sense-page .current-section {
    color: #C0A98D;
}

.theone-sense-page .nav-tab.active {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
    color: white;
}

/* 異數臻選 - 統一主題色 */
.special-selection-page .progress-fill {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
}

.special-selection-page .current-section {
    color: #C0A98D;
}

.special-selection-page .nav-tab.active {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
    color: white;
}

/* 美好再敘 - 統一主題色 */
.beautiful-retelling-page .progress-fill {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
}

.beautiful-retelling-page .current-section {
    color: #C0A98D;
}

.beautiful-retelling-page .nav-tab.active {
    background: linear-gradient(90deg, #C0A98D, #D4BFA3);
    color: white;
}

/* ==========================================
   動態背景遮罩 - 與首頁時段色彩同步
   ========================================== */

/* 基礎遮罩樣式 */
.page-header::before,
.section-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: all 0.5s ease;
    z-index: 1;
}

/* Morning (6:00-12:00) - 金色系 */
.time-period-morning .page-header::before,
.time-period-morning .section-background::before {
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.15) 0%,
        rgba(255, 237, 74, 0.1) 50%,
        rgba(255, 215, 0, 0.2) 100%
    );
}

/* Afternoon (12:00-17:00) - 橘色系 */
.time-period-afternoon .page-header::before,
.time-period-afternoon .section-background::before {
    background: linear-gradient(
        135deg,
        rgba(255, 140, 66, 0.15) 0%,
        rgba(255, 178, 102, 0.1) 50%,
        rgba(255, 140, 66, 0.2) 100%
    );
}

/* Evening (17:00-20:00) - 紅色系 */
.time-period-evening .page-header::before,
.time-period-evening .section-background::before {
    background: linear-gradient(
        135deg,
        rgba(255, 107, 107, 0.15) 0%,
        rgba(255, 140, 140, 0.1) 50%,
        rgba(255, 107, 107, 0.2) 100%
    );
}

/* Night (20:00-00:00) - 青色系 */
.time-period-night .page-header::before,
.time-period-night .section-background::before {
    background: linear-gradient(
        135deg,
        rgba(78, 205, 196, 0.15) 0%,
        rgba(110, 220, 210, 0.1) 50%,
        rgba(78, 205, 196, 0.2) 100%
    );
}

/* Midnight (00:00-06:00) - 紫色系 */
.time-period-midnight .page-header::before,
.time-period-midnight .section-background::before {
    background: linear-gradient(
        135deg,
        rgba(155, 89, 182, 0.15) 0%,
        rgba(180, 120, 200, 0.1) 50%,
        rgba(155, 89, 182, 0.2) 100%
    );
}

@media (max-width: 768px) {
    .floating-nav-tabs {
        bottom: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
        max-width: none;
        padding: 12px 15px;
    }
    
    .tabs-container {
        flex-wrap: wrap;
        gap: 3px;
        margin-bottom: 8px;
    }
    
    .nav-tab {
        padding: 6px 12px;
        font-size: 12px;
        flex: 1;
        text-align: center;
        min-width: calc(50% - 1.5px);
    }
    
    .tabs-toggle {
        width: 25px;
        height: 25px;
        font-size: 14px;
        margin-left: 5px;
        flex-shrink: 0;
    }
    
    .progress-indicator {
        font-size: 11px;
        gap: 8px;
    }
    
    .progress-bar {
        height: 3px;
    }
}

@media (max-width: 480px) {
    .floating-nav-tabs {
        bottom: 15px;
        right: 15px;
        left: 15px;
        padding: 10px 12px;
    }
    
    .nav-tab {
        padding: 5px 8px;
        font-size: 11px;
        min-width: calc(50% - 1.5px);
    }
    
    .tabs-toggle {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }
    
    .section-info {
        min-width: 30px;
        font-size: 11px;
    }
}

/* ==========================================
   隱藏內容區域
   ========================================== */

.hidden-content-sections {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

/* ==========================================
   動畫效果
   ========================================== */

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

.floating-nav-tabs {
    animation: slideInFromBottom 0.6s ease-out;
}

/* Tab 切換動畫 */
.nav-tab {
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.nav-tab:hover::before {
    left: 100%;
}

/* 進度條動畫 */
.progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================
   無障礙設計
   ========================================== */

.nav-tab:focus,
.tabs-toggle:focus {
    outline: 2px solid rgba(49, 54, 50, 0.5);
    outline-offset: 2px;
}

/* 高對比模式支援 */
@media (prefers-contrast: high) {
    .floating-nav-tabs {
        background: rgba(255, 255, 255, 1);
        border: 2px solid #000;
    }
    
    .nav-tab {
        border: 1px solid #666;
    }
    
    .nav-tab.active {
        background: #000;
        color: #fff;
        border-color: #000;
    }
}

/* 減少動畫偏好支援 */
@media (prefers-reduced-motion: reduce) {
    .floating-nav-tabs {
        animation: none;
    }
    
    .nav-tab,
    .tabs-toggle,
    .progress-fill,
    .floating-nav-tabs {
        transition: none !important;
    }
    
    .nav-tab::before,
    .progress-fill::after {
        display: none;
    }
}
