@import url("tokens.css");
/* stage_data.css */
.disclaimer-alert {
    background-color: #ffca28; /* Amber 400 */
    color: #111827;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
/* --- 統計パネル --- */
.control-panel {
    border-top: 3px solid #00e676;
}

.stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    background: #222;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Roboto Mono', monospace;
    font-variant-numeric: tabular-nums;
}

.stat-card.normal .stat-value { color: #fff; }
.stat-card.normal { border-color: #fff; }
.stat-card.online .stat-value { color: #29b6f6; }
.stat-card.online { border-color: #29b6f6; }
.stat-card.cancel .stat-value { color: #ef5350; }
.stat-card.cancel { border-color: #ef5350; }
.stat-card.event .stat-value { color: #ab47bc; } 
.stat-card.event { border-color: #7b1fa2; }
.stat-card.special .stat-value { color: #f48fb1; } 
.stat-card.special { border-color: #d81b60; }

.stats-detail-list {
    max-height: 400px;
    overflow-y: auto;
    background: #0d1118;
    border: 1px solid #334155;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #333;
}
.stats-row:last-child { border-bottom: none; }
.stats-row-name { color: #ddd; }
.stats-row-count { font-family: 'Roboto Mono', monospace; color: #fff; }

/* --- フォーム部品 --- */
.custom-input {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.date-range-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scrollable-checkbox-container {
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #ddd;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    accent-color: #00e676;
}

.checkbox-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #222;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #444;
}

.checkbox-group-inline label {
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
}
.checkbox-group-inline input {
    margin-right: 6px;
    accent-color: #00e676;
}

/* --- テーブル結果 --- */
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}
.status-normal { background-color: #444; color: #fff; border: 1px solid #666; }
.status-online { background-color: #0277bd; border: 1px solid #01579b; }
.status-cancel { background-color: #c62828; border: 1px solid #b71c1c; }
.status-postponed { background-color: #f57f17; color: #111827; border: 1px solid #f9a825; }
.status-special { background-color: #d81b60; border: 1px solid #c2185b; color: #fff; }

.setlist-name {
    display: block;
    font-size: 12px;
    color: #beffe0;
    margin-top: 4px;
}

/* --- [New] Team Colors --- */
/* Team H */
.team-h { color: #57d24a; font-weight: bold; } 
/* Team KIV */
.team-kiv { color: #2bf4ff; font-weight: bold; } 
/* Team TII */
.team-tii { color: #fff348; font-weight: bold; } 
/* ひまわり */
.team-himawari { color: #9f7142; font-weight: bold; } 
/* 研究生 */
.team-kenkyusei { color: #ff6593; font-weight: bold; } 

/* --- ページネーション --- */
.pagination-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px; /* 增加上下 Padding 令佢無咁壓迫 */
    margin-top: 15px;
    border-top: 1px solid #444;
    flex-wrap: wrap; /* 容許換行 */
    gap: 15px; /* 【關鍵】 確保所有元素之間至少有 15px 距離 */
}

/* 覆蓋 HTML 裡面嘅 inline style，統一由 CSS 控制間距 */
#page-info {
    margin: 0; /* 移除原本嘅 margin，改用 gap */
    font-weight: bold;
    color: #fff;
    white-space: nowrap; /* 防止文字斷開 */
}

/* --- 跳轉頁碼區塊 --- */
.page-jump-wrapper {
    display: flex;
    align-items: center;
    padding-left: 20px;
    border-left: 1px solid #666; /* 加深少少條線 */
    margin-left: 0; /* 由 gap 控制距離，唔使 margin */
}

@media (max-width: 600px) {
    .pagination-footer {
        flex-direction: column; /* 改為垂直排列 */
        gap: 15px;
    }

    /* 上半部：前頁 | 頁數 | 下頁 */
    /* 這裡我們可以稍微 hack 一下，令到頭三個元素（按鈕同文字）維持橫向，但跳轉區塊跌落去 */
    /* 但最簡單係直接讓 Flex wrap 發揮作用，或者調整跳轉區塊樣式 */

    .page-jump-wrapper {
        border-left: none;    /* 手機版移除左邊條線 */
        padding-left: 0;      /* 移除 Padding */
        padding-top: 15px;    /* 改為上方加空位 */
        border-top: 1px dashed #444; /* 改為上方加虛線分隔 */
        width: 100%;          /* 佔滿全闊 */
        justify-content: center; /* 居中 */
    }
    
    /* 微調輸入框大細 */
    #page-jump-input {
        width: 60px;
        padding: 8px;
    }
}

/* スクロールバー */
.scrollable-checkbox-container::-webkit-scrollbar,
.stats-detail-list::-webkit-scrollbar { 
    width: 6px; 
}
.scrollable-checkbox-container::-webkit-scrollbar-thumb,
.stats-detail-list::-webkit-scrollbar-thumb { 
    background: #555; 
    border-radius: 3px; 
}

/* --- [新增] 展開列表樣式 --- */

/* 按鈕樣式 */
.toggle-btn {
    background: none;
    border: 1px solid #666;
    color: #00e676;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.toggle-btn:hover {
    background: #10b981;
    color: #052e16;
}

/* 展開後のボタン状態 (JS で active クラスを付与) */
.toggle-btn.active {
    transform: rotate(45deg);
    background: #444;
    color: #fff;
    border-color: #fff;
}

/* 非表示の詳細行 */
.detail-row {
    background-color: #2a2a2a;
}

.detail-content {
    padding: 15px;
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.6;
    white-space: wrap;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 6px;
}

/* 成員名單 Tag 樣式 */
.member-tag {
    display: inline-block;
    background: #444;
    padding: 2px 8px;
    border-radius: 10px;
    margin: 2px;
    border: 1px solid #555;
    font-size: 12px;
}

/* 讓表格行之間有互動感 */
.position-table tbody tr.main-row:hover {
    background-color: #333;
}

.schedule-title {
    font-weight: bold;
    font-size: 14px; /* 強制固定大細，防止手機變大 */
    line-height: 1.4;
    margin-bottom: 4px;
}

/* 如果想係手機版再細啲，可以用 Media Query 微調 */
@media (max-width: 600px) {
    .schedule-title {
        font-size: 13px;
    }
}

/* --- Mobile Card Layout (手機版卡片式佈局) - 修復版 --- */
@media (max-width: 600px) {
    
    /* 1. 強制將表格結構變為 Block 結構，防止並排 */
    .position-table, 
    .position-table tbody {
        display: block;
        width: 100%;
    }

    .position-table thead {
        display: none;
    }

    /* 2. 主行 (Card) */
    .position-table tbody tr.main-row {
        display: flex;        /* 用 Flexbox 排版內部 */
        flex-wrap: wrap;
        align-items: baseline;
        position: relative;
        
        /* 【關鍵修正】 強制 100% 闊度，防止並排 */
        width: 100%; 
        box-sizing: border-box; /* 確保 Padding 唔會撐爆闊度 */
        
        padding: 12px 10px 12px 45px; 
        border-bottom: 1px solid #333;
    }

    /* 3. 重設 td */
    .position-table tbody tr.main-row td {
        display: block;
        border: none;
        padding: 0;
        box-sizing: border-box;
    }

    /* [第1欄] 按鈕 (+) */
    .position-table tbody tr.main-row td:nth-child(1) {
        position: absolute;
        left: 5px;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        text-align: center;
    }

    /* [第2欄] 日期 */
    .position-table tbody tr.main-row td:nth-child(2) {
        width: auto;
        font-weight: bold;
        font-size: 14px;
        margin-right: 8px;
    }

    /* [第3欄] 時間 */
    .position-table tbody tr.main-row td:nth-child(3) {
        width: auto;
        font-size: 13px;
        color: #aaa;
    }

    /* [第4欄] Team */
    .position-table tbody tr.main-row td:nth-child(4) {
        width: auto;
        margin-left: auto;
        font-size: 13px;
    }

    /* [第5欄] 標題 */
    .position-table tbody tr.main-row td:nth-child(5) {
        width: 100%;
        margin-top: 6px;
    }
    .schedule-title {
        font-size: 15px;
        line-height: 1.4;
        white-space: normal;
    }

    /* [第6欄] 會場 (隱藏) */
    .position-table tbody tr.main-row td:nth-child(6) {
        display: none;
    }

    /* [第7欄] 狀態 Badge */
    .position-table tbody tr.main-row td:nth-child(7) {
        width: 100%;
        margin-top: 8px;
    }

    /* --- 修復詳情行 (Detail Row) --- */
    /* 【關鍵修正】 強制詳情行也是 Block 並且 100% 闊 */
    .detail-row {
        display: block; /* 讓它表現得像一個區塊 */
        width: 100%;
    }

    .detail-row td {
        display: block;
        width: 100%;
        padding: 10px;
        background-color: #222;
        box-sizing: border-box;
    }
}

/* --- 目立たない進捗バー --- */
/* PC/共通の定義 */
.position-table tbody tr.main-row td.title-cell {
    position: relative;
}

.silent-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    opacity: 0.85; /* 適度な透明度で枠線になじむようにする */
    pointer-events: none; /* クリックイベントを妨げない */
    z-index: 1;
}

/* モバイル対応：カード全体の下部にバーを配置する */
@media (max-width: 600px) {
    .position-table tbody tr.main-row td.title-cell {
        position: static;
    }
}