/* ============================================
   CSS Variables & Base Styles
   ============================================ */
:root {
    --font-family: "Montserrat", sans-serif;
    --color-gold: linear-gradient(
        90deg,
        #ffde29,
        #fff17a 18.5%,
        #ffde29 38%,
        #ffd852 58%,
        #fff17a 75.5%,
        #ffde29 88%,
        #fe7
    );
}

body {
    font-family: var(--font-family) ;
}

.main-content {
    padding: 16px;
}

/* ============================================
   Match List & Schedule Styles
   ============================================ */
#match--list_wrapper .match--list_item a:hover,
#match--schedule_wrapper .match--schedule_item a:hover,
.match--schedule_item_template {
    color: inherit;
}

.match--list_item_hot {
    border-color:  red ;
}

#page-match--schedule_wrapper .ltdTitlt {
    width: 66.67%;
    margin: 0 auto;
}

.bg-gold,
.bg-gold:hover {
    background-image: var(--color-gold);
}

.xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ============================================
   Button Styles
   ============================================ */
.btn-join-room {
    background-color: #0000003d;
    border: 2px solid #f9e82e;
    border-radius: 8px;
    color: #f9e82e;
    font-weight: 600;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    font-size: 1.1rem;
    padding: 10px 20px;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-join-room:hover {
    background: linear-gradient(90deg, #f9e82e, #f9cc2e);
    color: #000;
}

/* ============================================
   Video Container Styles
   ============================================ */
.main-content-stream-video .dv2-video-wrapper {
    position: relative;
    width: 100%;
}

/* Fullscreen: override inline height from setHeightHome() on homepage */
.dv2-video-wrapper:fullscreen,
.dv2-video-wrapper:-webkit-full-screen {
    display: block;
    overflow: hidden;
}

.dv2-video-wrapper:fullscreen .dv2-video-container,
.dv2-video-wrapper:-webkit-full-screen .dv2-video-container,
.dv2-video-wrapper.dv2-stream-wrapper-fs .dv2-video-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dv2-video-wrapper:fullscreen .dv2-video-container video,
.dv2-video-wrapper:-webkit-full-screen .dv2-video-container video,
.dv2-video-wrapper.dv2-stream-wrapper-fs .dv2-video-container video {
    width: 100%;
    height: 100% ;
    max-height: 100%;
    object-fit: contain;
}

.dv2-video-wrapper:fullscreen .dv2-video-container img,
.dv2-video-wrapper:-webkit-full-screen .dv2-video-container img,
.dv2-video-wrapper.dv2-stream-wrapper-fs .dv2-video-container img {
    max-height: 100%;
}

.dv2-video-container {
    position: relative;
    width: 100%;
    min-height: 400px;
}

.dv2-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.dv2-video-container.aspect-video {
    aspect-ratio: 16 / 9;
}

.dv2-video-container.aspect-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   Loading Spinner Styles
   ============================================ */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.dv2-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.dv2-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ============================================
   Stream Layout Styles
   ============================================ */
.stream-full-width .main-content-stream-video,
.stream-full-width .match-info-container {
    width: 100% ;
    max-width: 100% ;
}

.stack-row:has(> .stream-full-width),
.stack-row:has(> .stream-detail-livechat) {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

.stack-row > .stream-full-width {
    flex: 1 1 auto ;
    min-width: 0;
    width: auto ;
    max-width: none ;
}

.stack-row > .stream-detail-livechat {
    flex: 0 0 var(--stream-chat-width, 380px) ;
    width: var(--stream-chat-width, 380px) ;
    min-width: var(--stream-chat-width, 380px) ;
    max-width: var(--stream-chat-width, 380px) ;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    margin-left: 0 ;
}

.stream-detail-livechat #livechat_app,
.stream-detail-livechat .tw-h-screen,
.stream-detail-livechat .dv2-layout-vb2-live-chat {
    flex: 1 1 auto;
    width: 100%;
    height: 100% ;
    min-height: 0;
}

.luongson-bet {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.luongson-bet a {
    background: #ffc71c;
    border-radius: 4px;
    color: #000;
    cursor: pointer;
    display: inline-block;
    font-size: 12px;
    height: 28px;
    line-height: 28px;
    margin-top: 0;
    text-decoration: none;
    width: 70px;
    text-align: center;
    font-weight: bold;
}

.match--schedule_bet {
    background: #ffc71c;
    border-radius: 4px;
    color: #000 ;
    cursor: pointer;
    display: inline-block;
    font-size: 12px;
    margin-top: 0;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    padding: 5px 15px;
}

.luongson-bet a:hover, .match--schedule_bet:hover {
    background: #bf0426;
    color: white ;
}

/* Filter match list text visibility - always show on both mobile and desktop */
.filter-match-text {
    display: block;
}

/* ============================================
   Match Info Overlay Styles
   ============================================ */
/* Match info overlay responsive styles */
@media (min-width: 768px) {
    #simulate-the-match-content-center {
        gap: 1rem ;
        padding: 1rem ;
    }

    .match-info__lname {
        font-size: 12px ;
        padding: 4px 12px ;
    }

    #simulate-the-match-content-center h4 {
        font-size: 18px ;
    }

    .timeBox {
        font-size: 24px ;
        gap: 12px ;
    }

    .teams {
        font-size: 14px ;
        gap: 1rem ;
        margin-top: 0.5rem ;
    }

    .homeTeam,
    .guestTeam {
        max-width: 150px ;
    }

    .teams .vs {
        font-size: 13px ;
    }
}

/* ============================================
   Responsive Styles - Mobile First
   ============================================ */

/* Mobile (<= 550px) */
@media (max-width: 550px) {
    .dv2-video-container {
        min-height: auto;
    }

    #simulate-the-match-content-center {
        top: 35%;
    }
}

/* Mobile (<= 640px) */
@media (max-width: 640px) {
    .main-content {
        padding: 5px;
    }
}

/* Mobile & Tablet (<= 768px) */
@media (max-width: 768px) {
    .btn-join-room {
        font-size: 12px;
        top: 30%;
    }
    
}

/* Tablet and Mobile (< 1024px) */
@media (max-width: 1023px) {
    .stack-row:has(> .stream-full-width),
    .stack-row:has(> .stream-detail-livechat) {
        flex-direction: column ;
        gap: 10px;
    }

    .stack-row > .stream-full-width,
    .stack-row > .stream-detail-livechat {
        flex: 1 1 100% ;
        width: 100% ;
        min-width: 0 ;
        max-width: 100% ;
    }

    .stream-detail-livechat {
        min-height: 360px;
    }

    .stream-detail-livechat #livechat_app,
    .stream-detail-livechat .tw-h-screen,
    .stream-detail-livechat .dv2-layout-vb2-live-chat {
        min-height: 360px;
    }

    /* Hide right logo section on mobile */
    .right-logo-section {
        display: none;
    }

    .main-content {
        padding: 10px;
    }
}

/* Medium desktop: sidebar + stream row */
@media (min-width: 1024px) and (max-width: 1360px) {
    .stack-row:has(> .stream-full-width) {
        --stream-chat-width: 340px;
        gap: 10px;
    }

    .dv2-video-container {
        min-height: 360px;
    }

    #main {
        max-width: calc(100vw - 15rem);
        overflow-x: hidden;
    }

    .main-content {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .gwd_notification {
        width: 100% ;
        max-width: 100% ;
        min-width: 0;
        box-sizing: border-box;
        overflow: hidden;
    }

    .gwd_notification .gwd-dynamic-html-container,
    .gwd_notification .gwd-dynamic-html-wrapper {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }
}

@media (max-width: 1360px) {
    .match-info-container {
        margin-top: 8px;
    }

    .match-info-container > .flex {
        min-height: 84px;
        align-items: stretch;
    }

    .match-info-container .z-10.flex {
        flex: 1 1 auto ;
        width: auto ;
        max-width: none ;
        padding: 10px 12px ;
        align-items: center;
        gap: 10px;
    }

    .match-info-container .commentator-avatar {
        width: 48px ;
        height: 48px ;
    }

    .match-info-container .flex.flex-col {
        gap: 3px;
        font-size: 13px;
        line-height: 1.3;
        justify-content: center;
    }

    .match-info-container .league-name {
        display: block;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        color: #ffde29;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .match-info-container .home-team-name,
    .match-info-container .away-team-name {
        font-size: 13px;
        font-weight: 700;
        color: #000;
        min-width: 0;
        max-width: none;
        flex: 1 1 0;
    }

    .match-info-container .space-x-2.font-semibold.flex-wrap {
        display: flex ;
        flex-wrap: nowrap ;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }

    .match-info-container .score-text {
        font-size: 17px ;
        font-weight: 800 ;
        color: #ffde29 ;
        line-height: 1;
        padding: 0 2px;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .match-info-container .commentator-name {
        font-size: 12px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.78);
    }

    .match-info-container .right-logo-section {
        flex: 0 0 34% ;
        width: 34% ;
        max-width: 220px;
        height: 84px ;
    }

    .match-info-container .right-logo-section .h-12 {
        height: 2.5rem ;
    }
}
/* Large desktop */
@media (min-width: 1361px) {
    .stack-row:has(> .stream-full-width) {
        --stream-chat-width: 400px;
    }
}

/* Desktop (>= 1024px) */
@media (min-width: 1024px) {
    .right-logo-section {
        display: flex;
    }
}