﻿.c-h-match {
    margin-top: 20px;
    align-items: center;
    background-color: #CF2228;
    height: 50px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.c-h-match h1{
    font-size: 14px;
    color: #fff;
    padding: 10px 20px;
    margin-bottom: 0;
}

.c-h-match a{
    font-size: 14px;
    color: red;
    font-weight: 700;
    padding: 5px 20px;
    background-color: #fff;
    border-radius: 5px;

}

.c-b-match .match{
    min-height: 320px;
}


.c-b-match .match img{
    width: 45px;
    height: 40px;
    margin: 5px 10px;
}

.c-b-match .row-1{
    padding: 25px 10px 0 10px;
    color: red;
    font-weight: 600;
}

.c-b-match .row-2 {
    padding-top: 20px;
}

.c-b-match .row-2 p {
    font-size: 30px;
    font-weight: 600;
}

.c-b-match .row-2 .time {
    padding: 5px 10px;
    font-size: 55px;
    background-color: #e5d8d8;
    border-radius: 10px;
}

.c-b-match .row-2 .score {
    padding: 5px 10px;
    font-size: 55px;
    background-color: #e5d8d8;
    border-radius: 10px;
}


.c-b-match .row-3{
    margin: 30px 0;
    padding-bottom: 20px;
}
.c-b-match .row-3 .player-event {
    width: 30%;
}

.c-b-match .row-3 .space {
    width: 40%;
    height: 1px;
}

.c-b-match .row-3 .event {
    width: 14px;
    height: 14px;
}

.c-match-statistic {
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;
}

.c-match-statistic .h-match-statistic{
    height: 80px;
    border-bottom: 1px solid #AEB4C4;
}

.h-match-statistic h2 {
    margin: 0 10px;
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid #AEB4C4;
    background-color: #ffffff;
    color: #38404D;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: "Bai Jamjuree",sans-serif;
}

    .h-match-statistic h2:hover {
        border-color: #e0e0e0;
        color: #333333;
        background-color: #f5f5f5;
    }

    .h-match-statistic h2.active {
        background-color: #CF2228;
        border-color: #e0e0e0;
        color: #ffffff;
    }




.b-match-statistic2 {
    width: 100%;
    background: #fff;
    padding: 40px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;   
}

.statistic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border: 1px solid #e5e5e5;
}

    .statistic-item:first-child {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }

    .statistic-item:last-child {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

.stat-value {
    font-weight: 600;
    font-size: 14px;
    min-width: 50px;
}

    .stat-value.left {
        text-align: right;
        padding-right: 15px;
    }

    .stat-value.right {
        text-align: left;
        padding-left: 15px;
    }

.stat-label {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: #666;
}

/*đội hình ra sân*/
.match-lineups {
    width: 100%;
    background: #fff;
    font-size: 14px;
    padding: 20px;
}

/* Header */
.lineups-header {
    display: flex;
    background: #CF2228;
    color: #fff;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.team-header {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .team-header a:hover {
        color: #fff;
    }

    .team-header.team-home {
        justify-content: flex-start;
    }

    .team-header.team-away {
        justify-content: flex-end;
    }

.team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.team-name {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    text-decoration: none;
}

    .team-name:hover {
        text-decoration: underline;
    }

.formation {
    font-size: 13px;
    color: #ccc;
}

/* Section titles */
.lineups-section {
    display: flex;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.section-title {
    flex: 1;
    padding: 10px 15px;
    font-weight: 600;
    color: #333;
}

    .section-title.team-home {
        text-align: left;
    }

    .section-title.team-away {
        text-align: right;
    }

/* Player rows */
.lineups-content {
    border: 1px solid #e0e0e0;
}

.player-row {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
}

    .player-row:last-child {
        border-bottom: none;
    }

.player-item {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 8px;
}

    .player-item.team-home {
        justify-content: flex-start;
        border-right: 1px solid #e0e0e0;
    }

    .player-item.team-away {
        justify-content: flex-end;
        /*flex-direction: row-reverse;*/
    }

.player-number {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 13px;
}

.player-name {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

    .player-name:hover {
        color: #CF2228;
        text-decoration: underline;
    }

.player-status {
    font-size: 12px;
    color: #999;
    min-width: 70px;
}

.player-item.team-home .player-status {
    text-align: right;
}

.player-item.team-away .player-status {
    text-align: left;
}

/* Position colors */
.status-gk {
    color: #FF9800;
}

.status-def {
    color: #2196F3;
}

.status-in {
    color: #4CAF50;
}

.status-forward {
    color: #F44336;
}

/* Coaches */
.coach-item {
    flex: 1;
    padding: 12px 15px;
}

    .coach-item.team-home {
        text-align: left;
        border-right: 1px solid #e0e0e0;
    }

    .coach-item.team-away {
        text-align: right;
    }

.coach-name {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

    .coach-name:hover {
        color: #CF2228;
        text-decoration: underline;
    }



.c-match-statistic .b-match-statistic {
    padding: 20px;
}

.b-match-statistic .form {
    font-weight: 600;
    font-size: 14px;
    line-height: 160%;
    color: #181C16;
}

.b-match-statistic .match-result{
    margin-top: 20px;
}
.match-result img {
    width: 20px;
    height: 20px;
}

.match-result a {
    color: #000;
    padding: 20px 20px;
    background-color: #fddede;
    border-radius: 10px;
}


/* Layout 2 cột */
.b-match-statistic .match-columns {
    display: flex;
    gap: 20px;
}

.b-match-statistic .match-column {
    flex: 1;
}

.b-match-statistic .team-header {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    padding: 15px 20px;
    background-color: #CF2228;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    justify-content: center;
}




/* ===== RESPONSIVE: < 1024px ===== */
@media (max-width: 1024px) {
    .c-b-match .match {
        min-height: 280px;
    }

    .c-b-match .row-2 p {
        font-size: 26px;
    }

    .c-b-match .row-2 .time,
    .c-b-match .row-2 .score {
        font-size: 30px;
    }

    /* CSS MỚI - Diễn biến */
    .block-detail-trandau {
        padding: 15px;
    }

    .head-team img {
        width: 32px;
        height: 32px;
    }

    .head-team .name {
        font-size: 15px;
    }

    .item-th {
        max-width: 220px;
    }
}

/* ===== RESPONSIVE: < 768px ===== */
@media (max-width: 767px) {
    .b-match-statistic2 {
        padding: 15px;
    }
    /* Lineups */
    .lineups-header {
        font-size: 13px;
    }

    .team-logo {
        width: 20px;
        height: 20px;
    }

    .player-item {
        padding: 8px 10px;
        font-size: 13px;
    }

    .player-number {
        min-width: 20px;
        font-size: 12px;
    }

    .player-status {
        display: none;
    }

    /* Match Statistic */
    .h-match-statistic {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        padding: 0 10px;
    }

        /* Style scrollbar */
        .h-match-statistic::-webkit-scrollbar {
            height: 6px;
        }

        .h-match-statistic::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .h-match-statistic::-webkit-scrollbar-thumb {
            background: #CF2228;
            border-radius: 3px;
        }

            .h-match-statistic::-webkit-scrollbar-thumb:hover {
                background: #a01b20;
            }

        .h-match-statistic button {
            flex-shrink: 0;
            min-width: fit-content;
            margin: 0 5px;
        }

    .b-match-statistic .match-columns {
        flex-direction: column;
        gap: 30px;
    }

    .b-match-statistic .match-column {
        width: 100%;
    }

    .b-match-statistic .team-header {
        font-size: 16px;
        padding: 12px 15px;
    }

    /* C-H-MATCH */
    .c-h-match {
        height: auto;
        padding: 12px 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

        .c-h-match p.time {
            font-size: 13px;
            padding: 8px 15px;
        }

        .c-h-match a {
            font-size: 13px;
            padding: 4px 16px;
        }

    .c-b-match .match {
        min-height: 250px;
    }

        .c-b-match .match img {
            width: 38px;
            height: 28px;
            margin: 5px 8px;
        }

    .c-b-match .row-2 p {
        font-size: 22px;
    }

    .c-b-match .row-2 .time,
    .c-b-match .row-2 .score {
        font-size: 20px;
        padding: 5px 8px;
    }

    .c-b-match .row-3 {
        margin-top: 20px;
    }

        .c-b-match .row-3 .player-event {
            width: 35%;
        }

        .c-b-match .row-3 .space {
            width: 30%;
        }

        .c-b-match .row-3 .name-player {
            font-size: 13px;
        }

        .c-b-match .row-3 .event {
            width: 12px;
            height: 12px;
        }

    /* CSS MỚI - Diễn biến */
    .block-detail-trandau {
        padding: 12px;
    }

    .head-top-team {
        padding: 12px 15px;
        margin-bottom: 25px;
    }

    .head-team img {
        width: 28px;
        height: 28px;
    }

    .head-team .name {
        font-size: 14px;
    }

    .item-dienbien {
        padding: 10px 0;
    }

    .item-th {
        padding: 6px 10px;
        max-width: 180px;
    }

    .icon-th {
        font-size: 18px;
        min-width: 20px;
    }

    .name-th {
        font-size: 13px;
    }

    .item-mins {
        min-width: 45px;
        height: 26px;
        font-size: 12px;
        left: -42px;
    }
}

/* ===== RESPONSIVE: < 480px ===== */
@media (max-width: 480px) {
    /* Lineups */
    .match-lineups {
        padding: 15px;
    }

    .formation {
        display: none;
    }

    /* Match Statistic */
    .b-match-statistic .match-columns {
        gap: 25px;
    }

    .b-match-statistic .team-header {
        font-size: 15px;
        padding: 10px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .match-result img.logo {
        width: 18px;
        height: 18px;
    }

    .match-result .team .name {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* C-H-MATCH */
    .c-h-match {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }

        .c-h-match p.time {
            font-size: 12px;
            padding: 6px 12px;
        }

        .c-h-match a {
            font-size: 12px;
            padding: 3px 14px;
        }

    .c-b-match .match {
        min-height: 220px;
    }

        .c-b-match .match img {
            width: 32px;
            height: 24px;
            margin: 4px 6px;
        }

    .c-b-match .row-1 {
        padding: 20px 10px 0 10px;
        font-size: 14px;
    }

    .c-b-match .row-2 {
        padding-top: 15px;
    }

        .c-b-match .row-2 p {
            font-size: 18px;
        }

        .c-b-match .row-2 .time,
        .c-b-match .row-2 .score {
            font-size: 16px;
            padding: 4px 6px;
            border-radius: 8px;
        }

    .c-b-match .row-3 {
        margin-top: 15px;
    }

        .c-b-match .row-3 .player-event {
            width: 38%;
        }

        .c-b-match .row-3 .space {
            width: 24%;
        }

        .c-b-match .row-3 .name-player {
            font-size: 12px;
        }

        .c-b-match .row-3 .minute-event {
            font-size: 11px;
        }

        .c-b-match .row-3 .event {
            width: 11px;
            height: 11px;
        }


        /*box diễn biến*/
    .block-detail-trandau {
        padding: 10px;
    }

    /* Header 2 đội */
    .head-top-team {
        gap: 20px;
        padding: 15px 10px;
    }

    .head-team {
        font-size: 14px;
        gap: 6px;
    }

        .head-team img {
            width: 24px;
            height: 24px;
        }

    /* Giảm padding để có nhiều không gian hơn cho tên */
    .inner-item-db.item-th-home {
        padding-right: 32px;
    }

    .inner-item-db.item-th-away {
        padding-left: 32px;
    }

    /* Box phút nhỏ hơn */
    .item-mins {
        min-width: 32px;
        height: 22px;
        font-size: 11px;
    }

    /* Tên cầu thủ - ellipsis khi quá dài */
    .name-th {
        font-size: 12px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Icon nhỏ hơn */
    .icon-th {
        font-size: 14px;
        min-width: 16px;
    }

    .icon-goal,
    .icon-yellow-card,
    .icon-red-card {
        font-size: 12px;
    }

    .icon-substitution-in,
    .icon-substitution-out {
        font-size: 14px;
    }

    /* Giảm chiều cao mỗi row */
    .item-dienbien {
        min-height: 38px;
    }

        .item-dienbien:has(.item-mins:empty) {
            min-height: 26px;
            margin-top: -6px;
        }

    /* Link sự kiện */
    .item-th {
        gap: 4px;
    }
}

}

/* ===== RESPONSIVE: < 375px ===== */
@media (max-width: 375px) {
    /* Match Statistic */
    .b-match-statistic .team-header {
        font-size: 14px;
        padding: 8px 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .match-result .team .name {
        max-width: 90px;
        font-size: 12px;
    }

    /* C-H-MATCH */
    .c-h-match p.time {
        font-size: 11px;
        padding: 5px 10px;
    }

    .c-h-match a {
        font-size: 11px;
        padding: 3px 12px;
        border-radius: 4px;
    }

    .c-b-match .match {
        min-height: 200px;
    }

        .c-b-match .match img {
            width: 28px;
            height: 22px;
            margin: 3px 5px;
        }

    .c-b-match .row-2 p {
        font-size: 16px;
    }

    .c-b-match .row-2 .time,
    .c-b-match .row-2 .score {
        font-size: 14px;
        padding: 3px 5px;
    }

    .c-b-match .row-3 .player-event {
        width: 40%;
    }

    .c-b-match .row-3 .space {
        width: 20%;
    }

    .c-b-match .row-3 .name-player {
        font-size: 11px;
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .c-b-match .row-3 .minute-event {
        font-size: 10px;
    }

    .c-b-match .row-3 .event {
        width: 10px;
        height: 10px;
    }

    .player-item a {
        max-width: 76px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /* CSS MỚI - Diễn biến */
    .head-top-team {
        gap: 15px;
    }

    .head-team .name {
        font-size: 13px;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .inner-item-db.item-th-home {
        padding-right: 28px;
    }

    .inner-item-db.item-th-away {
        padding-left: 28px;
    }

    .item-mins {
        min-width: 28px;
        height: 20px;
        font-size: 10px;
    }

    /* Tên cầu thủ ngắn hơn nữa */
    .name-th {
        font-size: 11px;
        max-width: 60px;
    }
}

/* ===== RESPONSIVE: < 320px ===== */
@media (max-width: 320px) {
    .c-b-match .match {
        min-height: 180px;
    }

    .c-b-match .row-2 .time,
    .c-b-match .row-2 .score {
        font-size: 14px;
    }

    .c-b-match .row-3 .name-player {
        max-width: 60px;
        font-size: 10px;
    }

    .c-b-match .row-3 .player-event {
        width: 42%;
    }

    .c-b-match .row-3 .space {
        width: 16%;
    }

    /* CSS MỚI - Diễn biến */
    /*.head-team img {
        width: 20px;
        height: 20px;
    }

    .head-team .name {
        font-size: 11px;
        max-width: 80px;
    }

    .item-th {
        max-width: 90px;
        padding: 4px 6px;
    }

    .icon-th {
        font-size: 14px;
        min-width: 16px;
    }

    .name-th {
        font-size: 10px;
        max-width: 60px;
    }

    .item-mins {
        min-width: 32px;
        height: 20px;
        font-size: 9px;
        left: -32px;
    }*/
}

/* ========================================
   CSS MỚI: BOX DIỄN BIẾN TRẬN ĐẤU
   ======================================== */

/* Container chính */
.block-detail-trandau {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Header 2 đội */
.head-top-team {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    padding: 20px;
    margin-bottom: 20px;
}
.head-team {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

    .head-team img {
        width: 28px;
        height: 28px;
    }

/* Container timeline */
.block-detail-trandau > .item-dienbien:first-of-type {
    margin-top: 10px;
}

/* Timeline - Mỗi sự kiện */
.item-dienbien {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 45px;
}

    /* Đường timeline xanh ở giữa */
    .item-dienbien::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 4px;
        background: red;
        transform: translateX(-50%);
    }

    /* Điểm tròn trên timeline - chỉ hiện khi có phút */
    .item-dienbien:has(.item-mins:not(:empty))::after {
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        width: 12px;
        height: 12px;
        background: #CF2228;
        border: 3px solid #fff;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        box-shadow: 0 0 0 2px #4CAF50;
        z-index: 3;
    }

/* Box chứa sự kiện bên trái (Home) */
.inner-item-db.item-th-home {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 50px;
}

/* Box phút ở giữa */
.item-mins {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 26px;
    background: #CF2228;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 4px;
    z-index: 5;
}

    /* Ẩn item-mins rỗng (dòng thứ 2 của substitution) */
    .item-mins:empty {
        display: none;
    }

/* Box chứa sự kiện bên phải (Away) */
.inner-item-db.item-th-away {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 50px;
}

/* Link sự kiện */
.item-th {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    padding: 4px 0;
}

    .item-th:hover .name-th {
        color: #38404D;
    }

/* Sự kiện bên Home - icon trước, tên sau */
.item-th-home .item-th {
    flex-direction: row;
}

/* Sự kiện bên Away - tên trước, icon sau */
.item-th-away .item-th {
    flex-direction: row;
}

/* Icon sự kiện */
.icon-th {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

.icon-goal {
    font-size: 14px;
}

.icon-yellow-card,
.icon-red-card {
    font-size: 14px;
}

.icon-substitution-in {
    font-size: 16px;
    font-weight: 900;
    color: #28a745 !important;
}

.icon-substitution-out {
    font-size: 16px;
    font-weight: 900;
    color: #dc3545 !important;
}

/* Tên cầu thủ */
.name-th {
    color: #333;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.2s;
}

/* Dòng thứ 2 của substitution (không có phút) - khoảng cách nhỏ hơn */
.item-dienbien:has(.item-mins:empty) {
    min-height: 30px;
    margin-top: -8px;
}

/* Bo tròn đầu và cuối timeline */
.block-detail-trandau > .item-dienbien:first-of-type::before {
    border-radius: 4px 4px 0 0;
    top: 50%;
}

.block-detail-trandau > .item-dienbien:last-of-type::before {
    border-radius: 0 0 4px 4px;
    bottom: 50%;
}

/* Responsive */
@media (max-width: 600px) {
    .inner-item-db.item-th-home {
        padding-right: 40px;
    }

    .inner-item-db.item-th-away {
        padding-left: 40px;
    }

    .item-mins {
        min-width: 38px;
        font-size: 12px;
    }

    .name-th {
        font-size: 13px;
    }

    .head-top-team {
        gap: 40px;
    }
}