:root {
    --primary: #ff4655;
    --lab-color: #00ffcc;
    --bg-dark: #0f1115;
    --card-bg: #1a1c24;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

body { background: var(--bg-dark); color: white; line-height: 1.6; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header & Nav */
header { background: #16191e; padding: 15px 0; border-bottom: 1px solid #2d2d2d; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 24px; font-weight: bold; }
.logo span { color: var(--primary); }

.nav-links { display: flex; list-style: none; gap: 20px; }
.nav-link { color: #888; text-decoration: none; font-size: 14px; transition: 0.3s; }
.nav-link:hover, .active-nav { color: white; }
.active-nav { color: var(--primary) !important; font-weight: bold; }

/* Lab Button Style */
.lab-btn { 
    color: var(--lab-color) !important; 
    border: 1px solid rgba(0, 255, 204, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
}
.lab-btn:hover { background: rgba(0, 255, 204, 0.1); }

.btn-signin { background: var(--primary); color: white; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* Content Styles */
#dynamic-content { margin-top: 40px; min-height: 500px; }

.match-card { background: var(--card-bg); padding: 25px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.data-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 8px; overflow: hidden; }
.data-table th { background: #252932; color: var(--primary); padding: 15px; text-align: left; font-size: 12px; }
.data-table td { padding: 15px; border-bottom: 1px solid #2d2d2d; }

/* Footer */
footer {
    background: #0a0b0d;
    padding: 60px 0;
    margin-top: 80px;
    border-top: 1px solid #222;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* Cột đầu tiên rộng gấp đôi */
    gap: 40px;
}

.footer-col h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    color: #888;
    font-size: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.footer-col ul li:hover {
    color: var(--primary);
}

.footer-col p {
    color: #666;
    font-size: 14px;
    max-width: 250px;
}
.loading {
    text-align: center;
    padding: 50px;
    color: var(--primary);
    font-weight: bold;
    letter-spacing: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

.vs {
    color: #555;
    font-weight: 900;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #f8f8f8; /* Nền sáng như trong hình */
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    border-radius: 4px;
    color: #333; /* Chữ tối trên nền sáng */
    position: relative;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
}

.close-modal {
    position: absolute; right: 20px; top: 10px;
    font-size: 28px; font-weight: bold; cursor: pointer; color: #888;
}

/* Detail UI inside Modal */
.detail-header { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 30px; border-bottom: 1px solid #ddd; padding-bottom: 10px; }
.event-info { color: #008eb3; font-weight: bold; display: flex; align-items: center; gap: 10px; }
.match-main { display: flex; justify-content: center; align-items: center; gap: 40px; padding: 40px 0; }
.match-main img { width: 100px; height: 100px; object-fit: contain; }
.match-main .score { font-size: 48px; font-weight: bold; color: #444; text-align: center; }
.match-main .score span { font-size: 12px; display: block; color: #999; font-weight: normal; }
.match-main .team-name { font-size: 24px; color: #008eb3; font-weight: bold; width: 200px; }
.map-veto { font-style: italic; text-align: center; color: #666; font-size: 14px; margin-top: 20px; border-top: 1px solid #ddd; padding-top: 20px; }

/* Bao ngoài cùng của trang chi tiết */
/* Giao diện dịch chuyển (Trắng) */
/* Container bao phủ toàn bộ vùng nội dung mới */
.match-detail-view {
    background-color: #f8f8f8; /* Màu nền trắng xám của HLTV/VLR */
    color: #333;
    padding: 30px;
    min-height: 80vh;
    border-radius: 4px;
}

.white-board { max-width: 1000px; margin: 0 auto; }

.board-header { 
    display: flex; justify-content: space-between; 
    border-bottom: 1px solid #ddd; padding-bottom: 15px; 
}

.event-title { color: #008eb3; font-weight: bold; font-size: 18px; }

.board-main {
    display: flex; justify-content: center; align-items: center;
    gap: 50px; padding: 60px 0;
}

.team-side { font-size: 26px; font-weight: bold; color: #008eb3; width: 250px; }
.left { text-align: right; }

.score-center { text-align: center; }
.score-numbers { font-size: 50px; font-weight: bold; color: #444; }

.board-footer {
    border-top: 1px solid #ddd; padding-top: 20px;
    text-align: center; font-style: italic; color: #777; font-size: 14px;
}

.back-link { color: #ff4655; cursor: pointer; font-weight: bold; margin-bottom: 20px; }

/* Giao diện danh sách sự kiện */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.event-card {
    background: var(--card-bg); /* Dùng biến màu tối của bạn */
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #2a3541;
    position: relative;
    transition: 0.3s;
}

.event-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.event-status {
    display: inline-block;
    padding: 4px 10px;
    background: #ff4655;
    font-size: 10px;
    font-weight: bold;
    border-radius: 4px;
    margin-bottom: 15px;
}

.event-status.upcoming {
    background: #555;
}

.event-card h3 {
    margin-bottom: 10px;
    color: var(--text-white);
}

.event-card p {
    font-size: 13px;
    color: #888;
    margin-bottom: 5px;
}

/* Hiệu ứng chung cho các card khi hover */
.team-card-hover {
    transition: all 0.3s ease; /* Giúp chuyển động mượt mà */
    cursor: pointer;
}

.team-card-hover:hover {
    transform: translateY(-5px); /* Nhấc card lên một chút */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); /* Đổ bóng mạnh hơn */
    border-color: #ff4655 !important; /* Đổi viền sang màu đỏ Valorant */
    background: #1f2326; /* Làm sáng nền một chút nếu muốn */
}
/* Container cho các thẻ Lab */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* Thẻ Lab trắng */
.lab-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lab-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Tiêu đề Lab */
.lab-card h3 {
    color: #000;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
}

/* Danh sách bài tập bên trong */
.lab-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.lab-list li {
    color: #555;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Nút "Xem chi tiết" màu xanh lá */
.btn-detail {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.btn-detail:hover {
    background-color: #2ecc71;
}
/* Style cho các đường link bài tập trong Lab */
.lab-link {
    text-decoration: none;
    color: #555; /* Màu xám mặc định */
    font-size: 14px;
    display: inline-block;
    padding: 5px 0;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.lab-link:hover {
    color: #ff4655; /* Đổi sang đỏ Valorant khi hover */
    padding-left: 5px; /* Hiệu ứng dịch sang phải nhẹ */
    border-bottom: 1px solid #ff4655;
}

/* Chỉnh lại thẻ li để không có dấu chấm tròn (nếu chưa có) */
.lab-list {
    list-style: none;
    padding: 0;
}

.lab-list li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    /* 1. Header & Menu: Dàn hàng dọc và căn giữa */
    .nav-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .nav-links {
        flex-wrap: wrap; /* Tự động xuống dòng nếu menu quá dài */
        justify-content: center;
        gap: 10px;
    }

    /* 2. Footer: Gập 4 cột ngang thành 1 cột dọc */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    .footer-col p {
        margin: 0 auto; /* Đưa đoạn văn bản ra giữa */
    }

    /* 3. Bảng Rankings: Cho phép vuốt ngang thay vì làm bẹp bảng */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap; /* Giữ nguyên một hàng không bị rớt chữ */
    }

    /* 4. Match Card (Ghi đè inline-style từ JS) */
    .match-card {
        flex-direction: column !important;
        text-align: center;
        gap: 10px;
        padding: 15px !important;
    }
    .match-card > div {
        justify-content: center !important; /* Đưa logo và tên đội ra giữa */
        width: 100%;
    }
    /* Chỉnh lại thời gian đếm ngược (Countdown) */
    .match-card > div:last-child {
        position: static !important;
        margin-top: 10px;
        text-align: center;
    }

    /* 5. Trang Chi tiết trận đấu (Match Detail) */
    .board-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .board-main {
        flex-direction: column; /* Ép 2 đội và tỉ số xếp dọc */
        gap: 30px;
        padding: 30px 0;
    }
    .team-side {
        width: 100%;
        text-align: center !important; /* Đưa tên đội ra giữa */
    }
    .score-numbers {
        font-size: 40px; /* Thu nhỏ tỉ số lại một chút */
    }
}
/* =========================================
   HIỆU ỨNG NỔI LÊN CHO MATCH CARD (INDEX)
========================================= */
.match-card {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
    cursor: pointer;
    border: 1px solid transparent !important;
}

.match-card:hover {
    transform: translateY(-8px); /* Nhấc bổng lên */
    box-shadow: 0 10px 30px rgba(255, 70, 85, 0.2) !important; /* Đổ bóng màu đỏ nhạt */
    border-color: var(--primary) !important; /* Hiện viền đỏ */
}

/* =========================================
   HIỆU ỨNG NHÁY ĐỎ CHO RANKINGS
========================================= */
/* Khi đưa chuột vào từng ô (Tên đội hoặc Khu vực) */
.data-table td:nth-child(2):hover, 
.data-table td:nth-child(3):hover {
    color: #ff4655; /* Đổi màu chữ sang đỏ */
    text-shadow: 0 0 8px rgba(255, 70, 85, 0.6); /* Hiệu ứng phát sáng nhẹ */
    transition: 0.2s ease;
    cursor: default;
}

/* Hiệu ứng cho cả dòng khi di chuyển chuột qua (tùy chọn để đẹp hơn) */
.data-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
    transition: 0.2s;
}