/* CSS cho bố cục tổng thể */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; background-color: #f0f2f5; }
.page-container { display: flex; max-width: 1600px; max-height: 800px; overflow: hidden; margin: auto; gap: 10px; border: 1px solid #e5e5e5;}
.sidebar-left { width: 250px; background-color: #fff; padding: 15px; border-right: 1px solid #ddd; height: 100vh; overflow-y: auto; }
.main-content-right { flex-grow: 1; padding: 20px; background-color: white; overflow: auto; scrollbar-width: none;}

/* === CSS cho Sidebar === */

/* Lịch */
.date-selector { display: flex; justify-content: space-around; text-align: center; margin-bottom: 20px; background-color: #f8f9fa; padding: 5px; border-radius: 8px; }
.date-selector .date-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; text-decoration: none; color: #333; transition: background-color 0.2s; }
.date-selector .date-item .day-number { font-size: 14px; font-weight: 500; }
.date-selector .date-item .day-of-week { font-size: 12px; color: #6c757d; }
.date-selector .date-item:hover { background-color: #e9ecef; }
.date-selector .date-item.active { background-color: #ff8c00; color: white; }
.date-selector .date-item.active .day-of-week { color: #fff; }

/* Các khu vực chung */
.sidebar-section h2 { font-size: 14px; color: #6c757d; text-transform: uppercase; margin: 25px 0 10px 0; padding-bottom: 5px; }

/* Danh sách giải đấu */
.league-list .league-item,
.league-list-grouped .league-item {
    display: flex; align-items: center; padding: 10px; border-radius: 6px;
    text-decoration: none; color: #212529; margin-bottom: 2px;
    font-size: 14px; transition: background-color 0.2s;
    gap: 5px;
}
.league-list .league-item:hover,
.league-list-grouped .league-item:hover { background-color: #f5f5f5; }

/* Highlight mục đang được chọn */
.league-list .league-item.active,
.league-list-grouped .league-item.active {
    background-color: #0d6efd;
    color: white;
    font-weight: 500;
}

/* Menu cha-con */
.league-list-grouped details { margin-bottom: 5px; }
.league-list-grouped summary { font-weight: bold; cursor: pointer; padding: 10px; border-radius: 4px; font-size: 15px; }
.league-list-grouped summary:hover { background-color: #eee; }
.league-list-grouped .league-group-items { padding-left: 10px; border-left: 2px solid #f0f0f0; margin-left: 5px; }
.date-selector {
    display: flex;
    justify-content: flex-start; /* Canh lề trái */
    text-align: center;
    margin-bottom: 20px;
    padding: 5px;
    border-radius: 8px;
    overflow-x: auto; /* Thêm cuộn ngang nếu không đủ chỗ */
    white-space: nowrap; /* Ngăn các item xuống dòng */
}
/* Ẩn thanh cuộn trên các trình duyệt phổ biến */
.date-selector::-webkit-scrollbar { display: none; }
.date-selector { -ms-overflow-style: none; scrollbar-width: none; }

.date-selector .date-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none; /* BỎ GẠCH CHÂN Ở ĐÂY */
    color: #333;
    transition: background-color 0.2s;
    margin-right: 5px; /* Thêm khoảng cách giữa các item */
    border: 1px solid transparent;
}
.date-selector .date-item .day-label { font-size: 14px; font-weight: 500; }
.date-selector .date-item .date-label { font-size: 12px; color: #6c757d; }

.date-selector .date-item:hover { background-color: #e9ecef; }
.date-selector .date-item.active {
    background-color: #ff8c00;
    color: white;
    border-color: #ff8c00;
}
.date-selector .date-item.active .date-label { color: #fff; }

/* Danh sách giải đấu (THÊM QUY TẮC MỚI) */
.league-list a,
.league-list-grouped a {
    text-decoration: none; /* BỎ GẠCH CHÂN CHO TẤT CẢ LINK GIẢI ĐẤU */
}



/* Thêm vào file assets/style.css */

.main-content-right h1 {
    font-size: 24px;
    margin-top: 0;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60vh;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}
.placeholder-content h2 {
    font-size: 22px;
    color: #343a40;
}
.placeholder-content p {
    font-size: 16px;
    color: #6c757d;
}

#json-details h2 {
    font-size: 18px;
    margin-top: 30px;
}

pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
}
pre.success {
    border-left: 5px solid #28a745;
}
.data-table-wrapper {
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.league-group-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #343a40;
    color: white;
    font-weight: bold;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.league-logo {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.data-table .table-header {
    display: flex;
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
}

.data-table .match-row {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.data-table .match-row:last-child {
    border-bottom: none;
}

/* Định nghĩa độ rộng các cột */
.col-time    { width: 10%; }
.col-match   { width: 40%; }
.col-score   { width: 15%; text-align: center; }
.col-odds    { width: 25%; }
.col-actions { width: 10%; text-align: center; }

.col-match .team-line {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.col-match .team-line:last-child { margin-bottom: 0; }
.team-logo {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.col-score {
    display: flex;
    flex-direction: column;
}
.ft-score { font-weight: bold; font-size: 16px; }
.ht-score { font-size: 12px; color: #6c757d; }
.sidebar-left img { max-width: 30px; }

/* Thêm vào file assets/style.css */
/* Header giải đấu */
.league-header { display: flex; align-items: center; padding-bottom: 15px; border-bottom: 2px solid #ff8c00; margin-bottom: 15px; }
.league-logo-container { flex-shrink: 0; width: 80px; height: 80px; margin-right: 20px; }
.league-logo-container img { width: 100%; height: 100%; object-fit: contain; }
.league-info { flex-grow: 1; }
.league-info .league-title { font-size: 24px; margin: 0 0 10px 0; border: none; }
.league-info p { margin: 4px 0; color: #6c757d; font-size: 14px; }
.season-selector select { padding: 8px 12px; border-radius: 6px; border: 1px solid #ddd; }

/* Tabs điều hướng */
.content-tabs { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 20px; }
.tab-item { padding: 10px 20px; text-decoration: none; color: #6c757d; font-weight: 500; border-bottom: 3px solid transparent; }
.tab-item.active { color: #ff8c00; border-bottom-color: #ff8c00; }

/* Lịch thi đấu / Kết quả */
.schedule-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.schedule-header h2 { font-size: 18px; border: none; }
.schedule-list { background-color: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.schedule-match-item { display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #f0f0f0; }
.schedule-match-item:last-child { border-bottom: none; }

.match-date { width: 15%; text-align: center; font-size: 14px; color: #6c757d; }
.match-status { font-weight: bold; }
.match-teams { width: 60%; display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.team-logo-small { width: 20px; height: 20px; vertical-align: middle; margin: 0 10px; }
.match-score { font-size: 16px; font-weight: bold; color: #e53935; white-space: nowrap; }
.match-odds { width: 15%; text-align: center; }
.match-analysis-link { width: 10%; text-align: center; }
/* Thêm vào file assets/style.css */
/* Sửa lại bố cục cho giống mẫu */
.schedule-match-item {
    display: grid;
    grid-template-columns: 15% 60% 15% 10%; /* Date | Teams | Odds | Link */
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.match-teams {
    /* Các style cũ giữ nguyên */
    padding: 0 15px; /* Thêm padding cho dễ nhìn */
}

/* Cột kèo chi tiết mới */
.match-odds-detailed {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #e53935;
}
.icon-corner { /* Cần có icon phạt góc, tạm thời dùng text */
    font-style: normal;
}
.icon-corner::before {
    content: '🚩'; /* Icon tạm */
    margin-right: 4px;
}

/* Bố cục grid mới cho dòng trận đấu */
.schedule-match-item {
    display: grid;
    /* Date | Teams | Extra Info | Link */
    grid-template-columns: 15% 55% 20% 10%; 
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

/* Căn chỉnh lại cột Tên đội và Tỷ số */
.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Tên đội nhà | Tỷ số | Tên đội khách */
    align-items: center;
    font-weight: 500;
    font-size: 14px;
}
.team-name.home-team { text-align: right; }
.team-name.away-team { text-align: left; }
.match-score-box {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #e53935;
    white-space: nowrap;
    margin: 0 10px;
}
.team-logo-small {
    width: 20px;
    height: 20px;
    margin: 0 8px;
}

/* Cột thông tin thêm (Góc, Kèo) */
.match-extra-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 13px;
    color: #6c757d;
}
.corner-info { color: #ff9800; /* Màu vàng cam cho phạt góc */ }
.odds-info-hdp, .odds-info-ou { color: #333; }

/* Cột link phân tích */
.match-analysis-link a {
    text-decoration: none;
    font-size: 18px;
}

/* Bố cục grid cho dòng trận đấu */
.schedule-match-item {
    display: grid;
    /* Date | Teams | Extra Info | Link */
    grid-template-columns: 15% 55% 20% 10%; 
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Tên đội nhà | Tỷ số | Tên đội khách */
    align-items: center;
    font-weight: 500;
    font-size: 14px;
}
.team-name.home-team { text-align: right; padding-right: 10px; }
.team-name.away-team { text-align: left; padding-left: 10px; }
.match-score-box {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #e53935;
    white-space: nowrap;
}
.team-logo-small {
    width: 20px;
    height: 20px;
}
.match-score-box .team-logo-small:first-of-type { margin-right: 10px; }
.match-score-box .team-logo-small:last-of-type { margin-left: 10px; }


/* Cột thông tin thêm (Góc, Kèo) */
.match-extra-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 13px;
    color: #6c757d;
}

/* Style mới cho kèo xếp chồng */
.odds-stack {
    display: flex;
    flex-direction: column;
    text-align: center;
}
.odds-line-compact {
    display: flex;
    justify-content: space-between;
    width: 100px; /* Cho chiều rộng cố định để dễ căn chỉnh */
}

/* Style cho Tab Content */
.tab-content {
    display: none; /* Mặc định ẩn tất cả nội dung */
}
.tab-content.active {
    display: block; /* Chỉ hiển thị nội dung của tab active */
}

/* Style cho Bảng xếp hạng */
.standing-table-wrapper {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden; /* Để bo góc table */
}
.standing-table {
    width: 100%;
    border-collapse: collapse;
}
.standing-table th, .standing-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}
.standing-table thead th {
    background-color: #f8f9fa;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}
.standing-table tbody tr:last-child td {
    border-bottom: none;
}
.standing-table .col-rank {
    font-weight: bold;
}
.standing-table .col-team {
    text-align: left;
    display: flex;
    align-items: center;
}
.standing-table .col-points {
    font-weight: bold;
    color: #0d6efd;
}

/* Thêm vào file assets/style.css */
.standing-stage {
    margin-bottom: 30px;
}
.stage-name {
    font-size: 18px;
    margin-bottom: 15px;
}
.standing-group {
    margin-bottom: 20px;
}
.group-name {
    font-size: 16px;
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* Thêm vào file assets/style.css */

/* Bố cục cho tab Thống kê */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.stats-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 20px;
}
.stats-title {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
}

/* Danh sách cầu thủ */
.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f8f9fa;
}
.stats-list li:last-child {
    border-bottom: none;
}
.player-name {
    font-weight: 500;
}
.player-team {
    color: #6c757d;
    font-size: 13px;
    margin: 0 10px;
    flex-grow: 1;
    text-align: right;
}
.stats-value {
    font-weight: bold;
    min-width: 20px;
    text-align: right;
}

/* Biểu tượng thẻ phạt */
.card {
    display: inline-block;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    margin-right: 8px;
}
.card.yellow { background-color: #ffc107; }
.card.red { background-color: #dc3545; }
.stats-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    min-width: 300px;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
}
.stats-table th, .stats-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.stats-table th {
    background: #e9ecef;
}


/* Modal chung */
    .modal {
        position: fixed;
        z-index: 10000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.6);
        display: none;
    }
    .modal-content {
        background-color: #fefefe;
        margin: 13% auto 5% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 90%;
        max-width: 1200px;
        max-height: 60vh;
        overflow-y: auto;
        border-radius: 8px;
        position: relative;
    }
    .close {
        color: #aaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
    }
    .close:hover { color: #000; }
    .popup-tabs {
        display: flex;
        margin-bottom: 20px;
    }
    .tab-btn {
        padding: 10px 20px;
        background: #f1f1f1;
        border: none;
        cursor: pointer;
        margin-right: 5px;
        border-radius: 4px;
    }
    .tab-btn.active {
        background: #007bff;
        color: white;
    }
    .tab-panel {
        display: none;
    }
    .tab-panel.active {
        display: block;
    }
    .match-stats-table {
        width: 100%;
        border-collapse: collapse;
    }
    .match-stats-table th, .match-stats-table td {
        padding: 8px;
        border: 1px solid #ddd;
        text-align: center;
    }
    .match-stats-table th {
        background: #e9ecef;
    }

    /* Lineup */
    .lineup-stats-table {
        margin-bottom: 20px;
        width: 100%;
    }
    .lineup-stats-table table {
        border-collapse: collapse;
        width: 100%;
    }
    .lineup-stats-table th, .lineup-stats-table td {
        padding: 8px;
        border: 1px solid #ddd;
        text-align: center;
        font-size: 14px;
    }
    .lineup-stats-table th {
        background: #f8f9fa;
    }
    .lineup-container {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        position: relative;
        background-size: cover;
        background-position: center;
        height: 500px;
    }
    .team-field {
        flex: 1;
        position: relative;
        height: 100%;
    }
    .team-field h3 {
        text-align: center;
        margin-bottom: 10px;
        font-size: 18px;
    }
    .player-jersey:hover {
        transform: scale(1.1);
    }
    .player-jersey svg {
        width: 100%;
        height: auto;
    }
.home-team-field .player-jersey.gk {
    top: 50%;
    left: 0% !important;
}
.team-field {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    position: relative;
    align-items: center;
}
.team-field.away-team-field {
    display: flex;
    justify-content: space-between;
    flex-direction: row-reverse;
}
.position-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2em;
    justify-content: space-between;
}

.player-jersey {
    /* Giữ nguyên style cũ, thêm flex nếu cần */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50px;
    position: relative;
}
.jersey-number {
    position: absolute;
    top: 10px;
    font-weight: 700;
    color: white;
}

.match-team {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1em;
}
.match-team h3 {
    margin: 0px;
    padding: 0px;
    text-align: center;
}
.loading {
    color: #888;
    font-style: italic;
}
.player-jersey {
    position: relative;
    margin: 2px;
}
.jersey-number, .jersey-name {
    position: absolute;
    font-size: 10px;
    color: #fff;
}
.jersey-name {
    top: 45px;
    left: 5px;
    width: 45px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.wpls-schedule-title { text-align:center; margin: 10px 0 12px; }
.wpls-table { width:100%; border-collapse: collapse; }
.wpls-table th, .wpls-table td { border:1px solid #e3e3e3; padding:8px 10px; font-size:14px; }
.wpls-table thead th { background:#2f3d40; color:#fff; text-align:left; }
.wpls-col-league { white-space:nowrap; font-weight:600; }
.wpls-col-time   { white-space:nowrap; }
.main-schedule {
    max-width: 1200px;
    margin: auto;
}
.wpls-table-scroller {
  max-height: 520px;            /* tuỳ chỉnh chiều cao mong muốn */
  overflow-y: auto;
  border: 1px solid #e3e3e3;    /* viền ngoài giống mẫu */
}

/* giữ header cố định khi cuộn */
.wpls-schedule-table {
  border-collapse: collapse;
  width: 100%;
}
.wpls-schedule-table thead th {
  position: sticky;
  top: 0;
  background: #2f3d40;          /* màu header trong mẫu */
  color: #fff;
  z-index: 2;
}

/* style hàng phân ngày */
.wpls-date-divider td {
  background: #3b3b3b;
  color: #fff;
  font-weight: 600;
}
.wpls-date-divider > td {
    text-align: center;
}
.wpls-schedule-table th, .wpls-schedule-table td {
  border: 1px solid #e3e3e3;
  padding: 8px 10px;
  text-align: left;
}
.wpls-col-league { white-space: nowrap; font-weight: 600; }
.wpls-col-time   { white-space: nowrap; }
.wpls-date-nav {
    margin: 8px 0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    border: 1px solid #e5e5e5;
    /* padding: 5px; */
    background: linear-gradient(to bottom, #fff, #e5e5e5, #fff); 
}
a.wpls-date-chip {
    padding: 0;
    border: none !important;
}


@media (max-width: 600px) {
  .wpls-table th, .wpls-table td { font-size:12px; padding:6px 8px; }
}


@media screen and (max-width: 480px){
    .sidebar-left {
        height: 500px;
        overflow: revert;
        width: 100%;
    }
    .sidebar-section {
        max-height: 200px;
        overflow: auto;
        border-bottom: 1px dashed;
        padding-bottom: 5px;
        margin-bottom: 5px;
        scrollbar-width: none;
    }
    .page-container {
        display: flex;
        max-width: 1600px;
        max-height: 1200px;
        overflow: scroll;
        scrollbar-width: none;
        margin: auto;
        gap: 10px;
        border: 1px solid #e5e5e5;
        flex-direction: column;
    }
    .main-content-right {
        padding: 5px;
    }
	.schedule-match-item {
		position: relative;
		display: flex;
        flex-direction: column;
	}
	.match-date {
		width: 100%;
    	display: flex;
    	justify-content: center;
    	gap: 1em;
    	border-bottom: 1px solid #e5e5e5;
    	margin-bottom: 5px;
	}
	.match-teams {
		display: grid;
    	grid-template-columns: 1fr auto 1fr;
    	align-items: center;
    	font-weight: 500;
    	font-size: 14px;
		width: 100%;
	}
	.team-name.home-team, .team-name.away-team {
		max-width: 100%;
    	white-space: nowrap;
    	overflow: hidden;
    	text-overflow: ellipsis;
	}
	.match-score-box {
		gap: 5px;
	}
	.match-extra-info { gap: 10px; }
	.match-analysis-link { width: auto; display: flex; justify-content: center; }
	.lineup-container {
		max-height: 160px;
	}
	.player-jersey { width: 20px; }
	.jersey-number, .jersey-name {
		font-size: 6px;
		top: 5px;
	}
	.position-group { gap: 1em; }
	.jersey-name {
		top: 20px;
    	left: 0px;
    	width: 22px;
    	white-space: nowrap;
    	overflow: hidden;
    	text-overflow: ellipsis;
	}
	.stats-table th {
		font-size: 12px;
	}
	.modal-content { font-size: 12px; }
	.wpls-date-nav {
	    gap: 0px !important;
	}
	a.wpls-date-chip {
	    padding: 4px 5px !important;
	}
}
