/* ===== 主頁面專用樣式 ===== */

/* Meeting Tabs 樣式 */
.meeting-tabs-container {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    max-height: 91px;
}

.meeting-tabs {
    display: flex;
    gap: 0.65rem;
    padding: 0.975rem;
    min-width: max-content;
}

.meeting-tab {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 21px;
    padding: 0.65rem 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.325rem;
}

.meeting-tab.active {
    background: #ff8c00;
    border-color: #ff8c00;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.meeting-tab:hover:not(.active) {
    background: #e9ecef;
    border-color: #dee2e6;
}

.meeting-tab .primary-text {
    font-size: 1.17rem;
    font-weight: 600;
    line-height: 1.2;
}

.meeting-tab .secondary-text {
    font-size: 0.975rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1.2;
}

/* 賽事列表容器 */
.race-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem;
    padding-bottom: 0; /* 移除底部內邊距，由 bottom-tips 處理 */
    /* 修正：確保滾動區域有足夠的空間 */
    min-height: 0;
    /* 修正：確保底部有足夠空間顯示免責聲明 */
    margin-bottom: 0;
    /* 修正：確保滾動區域不會超出容器 */
    max-height: calc(100vh - 260px);
}

.race-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* 底部提示區域 */
.bottom-tips {
    background: #f8f9fa;
    padding: 1.3rem 0.65rem 1.3rem 0.65rem; /* 調整底部間距 */
    text-align: center;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0; /* 防止被壓縮 */
    /* 修正：確保底部提示區域有固定高度 */
    min-height: 65px;
}

.tips-text {
    font-size: 0.975rem;
    color: #999;
    font-weight: 400;
    line-height: 1.4;
    font-style: italic;
}

/* 賽事項目樣式 */
.race-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.975rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 65px;
    overflow: hidden;
}

.race-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.race-item-voted {
    border-left: 3px solid #4CAF50;
    background: #f8fff8;
}

.race-item-not-voted {
    border-left: 3px solid #ff8c00;
    background: #fff8f0;
    animation: pulse 2s infinite;
}

.race-item-standard {
    border-left: 3px solid #e0e0e0;
}

/* 賽事項目頭部 */
.race-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
}

.race-info {
    display: flex;
    flex-direction: column;
    gap: 0.325rem;
    flex: 1;
}

.race-number {
    font-size: 1.17rem;
    font-weight: 600;
    color: #ff8c00;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.race-time {
    font-size: 1.04rem;
    color: #666;
    font-weight: 500;
}

.race-name {
    font-size: 0.975rem;
    color: #999;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 賽事詳情樣式 - 支持兩行布局 */
.race-details {
    font-size: 0.975rem;
    color: #999;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race-details .race-time {
    color: #666;
    font-weight: 500;
    margin-right: 0.65rem;
}

/* 狀態按鈕樣式 */
.status-badge {
    font-size: 0.91rem;
    padding: 0.26rem 0.65rem;
    border-radius: 13px;
    font-weight: 500;
    white-space: nowrap;
    background: #f0f0f0;
    color: #666;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 31px;
    min-height: 31px;
}

.status-badge svg {
    width: 21px;
    height: 21px;
    stroke: #666;
    transition: stroke 0.3s ease;
}

.status-badge:hover svg {
    stroke: #ff8c00;
}

.race-status {
    display: flex;
    flex-direction: column;
    gap: 0.325rem;
    align-items: flex-end;
}

/* 投票狀態標籤 */
.vote-status {
    font-size: 0.78rem;
    padding: 0.195rem 0.52rem;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.vote-status.voted {
    background: #4CAF50;
    color: white;
}

.vote-status.ended {
    background: #9e9e9e;
    color: white;
}

.vote-status.paid {
    background: #ff9800;
    color: white;
}

/* 狀態標籤與場次號碼的間隔 */
.status-labels-gap {
    margin-left: 0.975rem;
    display: inline-flex;
    align-items: center;
}

/* 脈衝動畫 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 140, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 140, 0, 0);
    }
}

/* 場次切換標籤樣式 */
.venue-tab {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 21px;
    padding: 0.65rem 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.325rem;
}

.venue-tab.active {
    background: #ff8c00;
    border-color: #ff8c00;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.venue-tab:hover:not(.active) {
    background: #e9ecef;
    border-color: #dee2e6;
}

.venue-tab .primary-text {
    font-size: 1.17rem;
    font-weight: 600;
    line-height: 1.2;
}

.venue-tab .secondary-text {
    font-size: 0.975rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1.2;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .meeting-tabs {
        padding: 0.65rem;
        gap: 0.325rem;
    }
    
    .meeting-tab {
        min-width: 104px;
        padding: 0.52rem 1.04rem;
    }
    
    .meeting-tab .primary-text {
        font-size: 1.04rem;
    }
    
    .meeting-tab .secondary-text {
        font-size: 0.91rem;
    }
    
    .race-item {
        padding: 0.78rem;
    }
    
    .race-number {
        font-size: 1.105rem;
    }
    
    .race-time {
        font-size: 0.975rem;
    }
    
    .race-name {
        font-size: 0.91rem;
    }
    
    .race-details {
        font-size: 0.91rem;
    }
    
    .status-badge {
        font-size: 0.845rem;
        padding: 0.195rem 0.52rem;
    }
    
    .vote-status {
        font-size: 0.715rem;
        padding: 0.156rem 0.455rem;
    }
    
    .status-labels-gap {
        margin-left: 0.78rem;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 375px) {
    .meeting-tab {
        min-width: 91px;
        padding: 0.39rem 0.78rem;
    }
    
    .meeting-tab .primary-text {
        font-size: 0.975rem;
    }
    
    .meeting-tab .secondary-text {
        font-size: 0.845rem;
    }
    
    .race-item-header {
        gap: 0.325rem;
    }
    
    .race-info {
        gap: 0.195rem;
    }
}
