/* PAYOMGAME - Main Enhanced v2.5 */

:root {
    --primary: #1e3a8a;       /* สีน้ำเงินหลัก */
    --primary-light: #f0f4ff; /* พื้นหลังสีอ่อน */
    --sport-color: #1565c0;   /* สีชื่อกีฬา (น้ำเงินสว่าง) */
    --time-color: #0f172a;    /* สีเวลา (ดำเหลือบน้ำเงิน) */
    --time-bg: #e2e8f0;       /* พื้นหลังเวลา */
    --accent: #ef4444;        /* สีแดง VS */
    --text-dark: #1e293b;
    --bg-body: #f8fafc;
}

body {
    background-color: var(--bg-body) !important;
    font-family: 'Kanit', sans-serif !important;
}

/* Date Navigator */
.date-navigator-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
    margin-bottom: 10px;
}
.date-navigator { display: flex; gap: 8px; }
.date-pill {
    background-color: #fff;
    color: #64748b;
    border-radius: 50px !important;
    padding: 8px 20px !important;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}
.date-pill:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}
.date-pill.active {
    background: linear-gradient(135deg, var(--primary), #3b82f6) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    border-color: transparent;
}

/* Match Table Styling */
.match-table thead th {
    background-color: var(--primary) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.match-table tbody td {
    vertical-align: middle !important;
    padding: 1.2rem 1rem !important;
    border-bottom: 1px solid #f1f5f9;
}

/* --- Custom Colors (ตามที่ขอ) --- */

/* 1. ชื่อกีฬา: สีน้ำเงินเข้ม/สว่าง */
.sport-title {
    color: var(--sport-color) !important;
    font-size: 1.15rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* 2. เวลา: ปรับให้เข้มและชัดเจน */
.time-badge {
    background-color: var(--time-bg);
    color: var(--time-color); /* สีดำ/เทาเข้ม อ่านง่าย */
    font-weight: 700;
    font-size: 1.1rem;
    padding: 8px 0;
    border-radius: 8px;
    display: block;
    width: 80px;
    margin: 0 auto;
    border: 1px solid #cbd5e1;
}

/* --- Badge Styling (แก้ไขป้ายที่ขาวให้มีสี) --- */
.badge-round {
    border-radius: 50px; /* ปรับให้มนเป็นวงรีสวยงาม */
    padding: 5px 12px;
    font-weight: 500;
    font-size: 0.85rem;
    margin-right: 4px;
    display: inline-block; /* ป้องกันการเพี้ยน */
    border: 1px solid transparent; /* เตรียมไว้สำหรับเส้นขอบ */
}

/* สีฟ้า (สำหรับเพศ/ประเภท) */
.badge-light-info {
    background-color: #e0f2fe !important; /* ฟ้าอ่อน */
    color: #0369a1 !important;      /* ฟ้าเข้มตัวหนังสือ */
    border-color: #bae6fd !important;
}

/* สีม่วง (สำหรับรอบการแข่งขัน) */
.badge-light-secondary {
    background-color: #f3e8ff !important; /* ม่วงอ่อน */
    color: #7e22ce !important;      /* ม่วงเข้มตัวหนังสือ */
    border-color: #e9d5ff !important;
}

/* สีส้ม (สำหรับสายการแข่งขัน) */
.badge-light-warning {
    background-color: #ffedd5 !important; /* ส้มอ่อน */
    color: #c2410c !important;      /* ส้มเข้มตัวหนังสือ */
    border-color: #fed7aa !important;
}

/* สีเขียว (สำหรับสถานะพิเศษ/ชนะเลิศ) */
.badge-light-success {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border-color: #bbf7d0 !important;
}

/* Icon */
.sport-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 8px;
    padding: 2px;
    background: #fff;
    border: 1px solid #e2e8f0;
}
.sport-icon-default {
    font-size: 24px;
    color: #94a3b8;
    width: 45px;
    text-align: center;
}

/* Versus Area */
.match-versus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.team-name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.4;
}
.team-left { text-align: right; padding-right: 15px; }
.team-right { text-align: left; padding-left: 15px; }

.vs-circle {
    background: var(--accent);
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.3);
}

/* Score Board */
.score-board {
    background: #1e293b;
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    font-family: 'Kanit', sans-serif;
}
.score { font-size: 1.1rem; font-weight: 700; padding: 0 5px; min-width: 20px; text-align: center; }
.winner { color: #4ade80; }

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .match-table thead { display: none; }
    
    .match-table tbody tr {
        display: block;
        background: #fff;
        border-radius: 12px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border: 1px solid #e2e8f0;
        padding: 0;
        overflow: hidden;
    }

    .match-table tbody td {
        display: block;
        border: none !important;
        padding: 10px 15px !important;
    }

    /* Time Header on Mobile */
    .time-cell {
        background-color: #f1f5f9;
        border-bottom: 1px dashed #e2e8f0 !important;
        padding: 8px 15px !important;
        text-align: left !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .time-badge {
        background: none;
        border: none;
        color: var(--primary);
        font-size: 1rem;
        padding: 0;
        width: auto;
        margin: 0;
    }
    .time-cell::before {
        content: "🕒 เวลาแข่งขัน";
        color: #64748b;
        font-size: 0.9rem;
        font-weight: 500;
    }

    /* Sport Center */
    .sport-cell {
        text-align: center;
        padding-top: 15px !important;
    }
    .sport-cell .d-flex {
        flex-direction: column;
        justify-content: center;
    }
    .sport-title {
        font-size: 1.2rem;
    }
    
    /* Versus Stack */
    .match-versus {
        flex-direction: column;
        gap: 8px;
        background: #f8fafc;
        padding: 15px;
        border-radius: 10px;
        margin-top: 5px;
    }
    .team-name { text-align: center; width: 100%; padding: 0; }
    .vs-badge-container { margin: 5px 0; }
}