/* FB400 - 時間軸查詢頁面樣式 */

/* 隱藏滾動條 */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 拖曳游標 */
.cursor-grabbing {
    cursor: grabbing;
}

/* 數字等寬 */
.tabular-nums {
    font-feature-settings: "tnum";
}

/* 時間軸按鈕樣式 */
.timeline-wrapper button {
    color: #204B73;
    border: 1px solid #204B73;
    background-color: #fff;
}

.timeline-wrapper button:hover {
    background-color: #204B73;
    color: #fff;
}

/* 時間軸卡片樣式 */
.timeline-cards {
    max-width: 318px;
    height: 328px;
    aspect-ratio: 3/4;
    position: absolute;
    cursor: pointer;
    opacity: 0;
    filter: blur(4px);
    transform: scale(0.6);
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (max-width: 900px) {
    .timeline-cards {
        transform: scale(0.4);
        display: flex;
        justify-content: center;
    }
}

.timeline-cards.page-visible {
    opacity: 1;
    pointer-events: auto;
}

.timeline-cards.active {
    filter: blur(0);
    transform: scale(1);
    z-index: 9;
}

@media (max-width: 900px) {
    .timeline-cards.active {
        filter: blur(0);
        transform: scale(0.8);
        z-index: 9;
    }
}

/* 分頁控制 */
#timeline-pagination-controls {
    padding: 25px;
    display: flex;
    justify-content: left;
    gap: 10px;
    min-height: 32px;
    max-width: 600px;
    width: 50%;
}

@media (max-width: 768px) {
    #timeline-pagination-controls {
        padding: 25px;
        display: flex;
        justify-content: flex-start;
        gap: 20px;
        min-height: 32px;
        max-width: 600px;
        width: 80%;
        direction: ltr;
        overflow-x: scroll;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
    }

    #timeline-pagination-controls > div {
        width: max-content;
        min-width: max-content;
        flex-wrap: nowrap;
        justify-content: flex-start !important;
    }

    #timeline-pagination-controls.pagination-centered > div {
        width: 100%;
        min-width: 100%;
        justify-content: center !important;
    }
}

/* 分頁點 */
.timeline-dot {
    min-width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #666;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.timeline-dot:hover {
    background-color: #888;
}

.timeline-dot.active {
    background-color: #568EC7;
    transform: scale(1.5);
}

/* L型邊框裝飾 */
.l-shape-box-pseudo {
    position: relative;
    height: 100%;
    --corner-color: #007AFF;
    --corner-length: 20px;
    --corner-thickness: 3px;
}

.l-shape-box-pseudo .content {
    position: relative;
    height: 100%;
}

/* 統一設定四個偽元素的基礎樣式 */
.l-shape-box-pseudo .content::after,
.l-shape-box-pseudo .content::before,
.l-shape-box-pseudo::after,
.l-shape-box-pseudo::before {
  content: "";
  position: absolute;
  width: var(--corner-length);
  height: var(--corner-length);
  border-color: var(--corner-color);
  border-style: solid;
}

/* 分別用 border 來畫出 L 型 */
/* 左上角 */
.l-shape-box-pseudo::before {
  top: 0;
  left: 0;
  border-width: var(--corner-thickness) 0 0 var(--corner-thickness);
}

/* 右上角 */
.l-shape-box-pseudo::after {
  top: 0;
  right: 0;
  border-width: var(--corner-thickness) var(--corner-thickness) 0 0;
}

/* 左下角 */
.l-shape-box-pseudo .content::before {
  bottom: 0;
  left: 0;
  border-width: 0 0 var(--corner-thickness) var(--corner-thickness);
}

/* 右下角 */
.l-shape-box-pseudo .content::after {
  bottom: 0;
  right: 0;
  border-width: 0 var(--corner-thickness) var(--corner-thickness) 0;
}

/* 時間軸年代區域 */
.timeline-era-left,
.timeline-era-right {
    background-repeat: repeat-y;
}

/* 手機版時間軸卡片容器 */
@media (max-width: 767px) {
    #timeline-card-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        position: static;
        height: 800px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .timeline-cards,
    .timeline-cards.active {
        position: static !important;
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
        pointer-events: auto !important;
        z-index: auto !important;
    }

    #timeline-pagination-controls {
        display: none;
    }

    #timeline-pagination-controls:not(.hidden) {
        display: flex !important;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
    }

    #timeline-pagination-controls > div {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
        max-width: 100%;
    }
}

/* 時間軸選單樣式 */
.timeline-menu > li > a {
    padding: 8px 16px;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.timeline-menu > li > a:hover {
    background-color: rgba(32, 75, 115, 0.1);
}

.timeline-menu > li > a.active {
    background-color: #204B73;
    color: #fff;
}

/* 月份柱狀圖容器 */
.monthly-charts {
    margin-top: 16px;
    padding: 0 16px;
}

#monthly-bars-container {
    min-height: 80px;
}

/* 卡片標題截斷 */
.item-title.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 卡片圖片預設樣式 */
.item-image {
    background-color: #f3f4f6;
    background-position: center;
    background-size: cover;
}

/* 年份數量顯示 */
#current-year-data {
    font-size: 1.125rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 無資料提示 */
#timeline-card-container > p.text-gray-500 {
    font-size: 1rem;
    padding: 2rem;
}

/* 時間軸導航按鈕 */
.timeline-nav-buttons {
    position: relative;
    z-index: 20;
}

.timeline-nav-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-nav-btn:hover {
    transform: scale(1.1);
}

.timeline-nav-btn:active {
    transform: scale(0.95);
}

#cardIndexDisplay {
    user-select: none;
}

/* 確保 modal 視窗永遠蓋過 nav/footer */
.recommended-card-popup,
#apply-popup-digital,
.collection-popup,
.modal {
    position: fixed;
    z-index: 2000; /* 高於 nav (1000) */
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

@media (max-width: 767px) {
    .timeline-era-left {
        display: none;
    }
}