/* ============================================
   FIX: Lịch Phát Sóng Trực Tiếp Layout
   Match với ảnh - UI hoàn thiện
   ============================================ */

/* Fix container width and overflow */
.match-live {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.match-live-list {
    width: 100% !important;
    max-width: 100% !important;
    /* Use hidden for transform-based scrolling (Vue), auto for native scrolling (mobile) */
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    position: relative !important;
    margin-top: 25px !important;
}

/* Fix wrap container - ensure proper flex layout */
.match-live-list .wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    /* Width is set dynamically by Vue, don't override */
    min-width: 100% !important;
    transition: transform 0.4s ease-out !important;
    gap: 0 !important;
    will-change: transform !important;
}

/* Fix match cards - Match với ảnh */
.match-live-list .wrap .match-live-item {
    width: 318px !important;
    min-width: 318px !important;
    max-width: 318px !important;
    min-height: auto !important;
    max-height: 260px !important;
    height: auto !important;
    padding: 12px !important;
    border-radius: 12px !important;
    background-color: #fff !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    margin-right: 12px !important;
    border: 1px solid #e3e3e3 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

.match-live-list .wrap .match-live-item:last-child {
    margin-right: 0 !important;
}

/* Top section - Match với ảnh */
.match-live-item .top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 12px !important;
    color: #666 !important;
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: 18px !important;
    max-height: 22px !important;
    margin-bottom: 0 !important;
    line-height: 1.3 !important;
}

.match-live-item .top .name {
    width: 100% !important;
}

.match-live-item .top .time {
    flex-shrink: 0 !important;
}

/* Middle section - Match với ảnh */
.match-live-item .middle {
    margin-top: 10px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: 130px !important;
    max-height: 150px !important;
}

/* Team info - Match với ảnh */
.match-live-item .team-info {
    width: 40.5% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    height: auto !important;
    min-height: 110px !important;
    max-height: 130px !important;
    flex-shrink: 0 !important;
}

/* Logo box - Match với ảnh: 40px x 40px */
.match-live-item .team-info .logo-box {
    width: 40px !important;
    height: 40px !important;
    margin: 0 auto !important;
    background-color: #f8f8f8 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

/* Logo inside logo-box - Match với ảnh: 34px x 34px */
.match-live-item .team-info .logo-box .logo {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background-color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.match-live-item .team-info .logo-box .logo .placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.match-live-item .team-info .logo-box .logo .placeholder .el-image {
    width: 100% !important;
    height: 100% !important;
}

.match-live-item .team-info .logo-box .logo .placeholder .el-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Team name - Match với ảnh */
.match-live-item .team-info .name {
    margin-top: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-align: center !important;
    font-family: PingFangSC-Semibold, PingFang SC, sans-serif !important;
    height: auto !important;
    min-height: 30px !important;
    max-height: 38px !important;
    line-height: 1.3 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    display: -webkit-box !important;
    word-wrap: break-word !important;
}

/* Score box - Match với ảnh */
.match-live-item .middle .score-box {
    min-width: 19% !important;
    max-width: 26% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    margin-top: 0 !important;
    align-self: center !important;
}

.match-live-item .middle .score-box .mins {
    text-align: center !important;
    font-size: 11px !important;
    color: #dd1818 !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
}

.match-live-item .middle .score-box .score-info {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 0 !important;
    margin-bottom: 2px !important;
}

.match-live-item .middle .score-box .score-info .val {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #666 !important;
    line-height: 1.3 !important;
}

.match-live-item .middle .score-box .score-info .val.lead {
    color: #dd1818 !important;
}

.match-live-item .middle .score-box .score-info .line {
    width: 8px !important;
    height: 2px !important;
    background-color: #666 !important;
    margin: 0 6px !important;
}

.match-live-item .middle .score-box .vs {
    font-size: 18px !important;
    font-weight: 600 !important;
    text-align: center !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
}

.match-live-item .middle .score-box .icon-appoint {
    width: 15px !important;
    height: 18px !important;
    margin: 4px auto 0 !important;
    background-position: -159px -40px !important;
    cursor: pointer !important;
}

/* Bottom section - Match với ảnh */
.match-live-item .bottom {
    margin-top: 10px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: 36px !important;
    max-height: 44px !important;
}

.match-live-item .bottom .anchor-list {
    display: flex !important;
    justify-content: center !important;
}

.match-live-item .bottom .anchor-list .anchor-item {
    position: relative !important;
    margin-right: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.match-live-item .bottom .anchor-list .anchor-item:last-child {
    margin-right: 0 !important;
}

/* Avatar - Match với ảnh: 30px x 30px */
.match-live-item .bottom .anchor-list .anchor-item .avatar {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background-color: #fff !important;
    display: block !important;
}

/* Live tag - Match với ảnh */
.match-live-item .bottom .anchor-list .anchor-item .live {
    width: 28px !important;
    height: 13px !important;
    line-height: 13px !important;
    background: #dd1818 !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-size: 11px !important;
    text-align: center !important;
    position: absolute !important;
    bottom: -4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix header layout */
.match-live .header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    position: relative !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.match-live .header .left {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.match-live .header .right {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    gap: 12px !important;
    position: relative !important;
    right: auto !important;
    top: auto !important;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .match-live-list {
        /* Allow native scrolling on mobile for better UX */
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }

    /* Disable transform scrolling on mobile, use native scroll */
    .match-live-list .wrap {
        transform: none !important;
        width: auto !important;
        gap: 8px !important;
    }

    .match-live-list .wrap .match-live-item {
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        max-height: 260px !important;
        padding: 8px !important;
        margin-right: 8px !important;
    }
    
    .match-live-item .middle {
        margin-top: 6px !important;
        min-height: 100px !important;
        max-height: 120px !important;
    }
    
    .match-live-item .team-info .logo-box {
        width: 36px !important;
        height: 36px !important;
    }
    
    .match-live-item .team-info .logo-box .logo {
        width: 30px !important;
        height: 30px !important;
    }
    
    .match-live-item .team-info .name {
        font-size: 11px !important;
        margin-top: 5px !important;
        max-height: 32px !important;
    }
    
    .match-live-item .middle .score-box {
        margin-top: 3px !important;
    }
    
    .match-live-item .middle .score-box .score-info .val {
        font-size: 16px !important;
    }
    
    .match-live-item .middle .score-box .vs {
        font-size: 16px !important;
    }
    
    .match-live-item .bottom {
        margin-top: 6px !important;
        max-height: 36px !important;
    }
    
    .match-live-item .bottom .anchor-list .anchor-item .avatar {
        width: 28px !important;
        height: 28px !important;
    }

    .match-live .header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .match-live .header .right {
        align-self: flex-end !important;
        margin-top: 10px !important;
    }
}

/* Hide scrollbar but keep functionality */
.match-live-list::-webkit-scrollbar {
    height: 6px;
}

.match-live-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.match-live-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.match-live-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}
