﻿/* Reset và kiểu tổng thể */
:root {
    --contest-primary: #007bff;
    --contest-primary-dark: #004085;
    --contest-section-header: #00529c;
    --contest-section-header-dark: #011d7e;
    --contest-statistics: #0b57d0;
    --contest-statistics-total: #3498db;
    --contest-statistics-tab: #0d65f2;
    --contest-statistics-accent: #5090f6;
    --contest-footer: #00529c;
    --contest-footer-dark: #011d7e;
    --contest-accent: #ffd700;
    --contest-border: #d8e6f3;
    --primary: #b80101;
    --primary-dark: #a50202;
    --primary-light: #d32f2f;
    --secondary: #074581;
    --secondary-dark: #053761;
    --secondary-light: #0a5ca8;
    --accent: #f0ad4e;
    --accent-dark: #eea236;
    --accent-light: #f6c073;
    --light: #ffffff;
    --dark: #333333;
    --gray-light: #f8f9fa;
    --gray: #e9ecef;
    --gray-dark: #ced4da;
    --shadow: 0 .25rem .75rem rgba(0,0,0,.1);
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.05);
    --border-radius: .35rem;
}

body {
    background: linear-gradient(135deg, #e6f0fa, #f6faff);
    font-family: 'Inter', sans-serif;
    color: #1a202c;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container-fluid.cssShadow {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-width: 1300px;
    margin: 0px auto;
    padding: 5px;
}

/* Header cuộc thi */
.quiz-header {
    text-align: center;
    padding: 0px 0;
    background: #fff;
    border-radius: 12px;
    color: #ffffff;
    margin-bottom: 5px;
    animation: fadeIn 0.5s ease-out forwards;
}

    .quiz-header h1 {
        font-family: 'Poppins', sans-serif;
        font-size: 32px;
        font-weight: 700;
        margin: 0;
        text-transform: uppercase;
    }

/* Khu vực chính: Quảng cáo và đếm ngược */
.main-content {
    margin-bottom: 20px;
}

.ads4-section {
    background: linear-gradient(135deg, #edf2f7, #ffffff);
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--contest-border);
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out forwards;
}

/* Box thời gian đếm ngược */
.countdown-container {
    background: linear-gradient(135deg, #ffffff, #f7fafc);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    text-align: center;
    max-width: 100%;
    height: 100%;
    animation: fadeIn 0.5s ease-out forwards;
}

    .countdown-container .header-date {
        font-size: 18px;
        font-weight: 500;
        color: #4a5568;
        background: #edf2f7;
        padding: 15px 24px;
        border-radius: 24px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 25px;
    }

    .countdown-container .glyphicon-time {
        font-size: 18px;
    }

    .countdown-container .countdown-title {
        font-family: 'Poppins', sans-serif;
        font-size: 27px;
        font-weight: 600;
        color: #2b6cb0;
        text-transform: uppercase;
        margin: 0 0 15px;
    }

.cssTimeTable {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 20px;
    border-collapse: collapse;
}

    .cssTimeTable td {
        padding: 6px;
    }

.boxNgay, .boxGio, .boxPhut, .boxGiay {
    display: block;
    font-size: 32px;
    font-weight: 600;
    color: #ffffff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

    .boxNgay:hover, .boxGio:hover, .boxPhut:hover, .boxGiay:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

.boxNgay {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

.boxGio {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.boxPhut {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.boxGiay {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}

.noteNgay, .noteGio, .notePhut, .noteGiay {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.contest-stats {
    margin: 20px 0;
    padding: 15px;
    background: var(--contest-statistics-total, #3498db);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contest-stats {
    transition: all 0.3s ease;
}

    .contest-stats:hover {
        background: var(--contest-statistics-total, #3498db);
        filter: brightness(0.88);
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .contest-stats h3 {
        font-family: 'Oswald', sans-serif;
        font-size: 18px;
        font-weight: 600;
        margin: 0;
    }

    .contest-stats .numLuot {
        font-size: 18px;
        font-family: 'Oswald', sans-serif;
        font-weight: 700;
    }

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btnContest {
    background: linear-gradient(var(--contest-primary-dark), var(--contest-primary));
    color: #ffffff;
    padding: 10px 30px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    font-family: 'Oswald', sans-serif;
}

    .btnContest#btnVaoThi {
        background: linear-gradient(#004085, #007bff);
    }

    .btnContest#btnTheLe {
        background: #2ecc71;
    }

    .btnContest:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

    .btnContest#btnVaoThi:hover {
        background: #c0392b;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        color: #fff; /* đổi màu chữ */
        letter-spacing: 1px; /* giãn chữ */
        font-weight: 600; /* làm đậm */
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); /* đổ bóng chữ */
    }

    .btnContest#btnTheLe:hover {
        background: #c0392b;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        color: #fff; /* đổi màu chữ */
        letter-spacing: 1px; /* giãn chữ */
        font-weight: 600; /* làm đậm */
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); /* đổ bóng chữ */
    }

/* Bảng thống kê */
.stats-section {
    margin: 30px 0;
}

    .stats-section h3 {
        font-family: 'Oswald', sans-serif;
        font-size: 24px;
        color: var(--contest-statistics, #00529c);
        text-transform: uppercase;
        text-align: center;
        margin-bottom: 20px;
    }

.stats-table-wrapper {
    background-color: var(--light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto; /* Kích hoạt thanh cuộn dọc */
    border: 1px solid var(--contest-border);
}

.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    overflow: hidden;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-table th {
    background: var(--contest-statistics, #00529c);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 16px;
    text-align: center;
    text-transform: uppercase;
    border-bottom: 2px solid var(--contest-border);
    position: sticky; /* Giữ header cố định khi cuộn */

}

.stats-table td {
    padding: 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #1a202c;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

    .stats-table td:nth-child(2) {
        text-align: left;
    }

    .stats-table td:nth-child(3) {
        text-align: center;
        font-weight: 600;
        color: var(--contest-statistics, #00529c);
        transition: transform 0.2s ease;
    }

        .stats-table td:nth-child(3):hover {
            transform: scale(1.1);
        }

.stats-table tr:nth-child(even) {
    background: #f7fafc;
}

.stats-table tr:hover {
    background: #edf2f7;
    transition: background 0.3s ease;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table th:first-child, .stats-table td:first-child {
    width: 50px;
}

.stats-table th:nth-child(2), .stats-table td:nth-child(2) {
    width: 200px;
}

.stats-table th:nth-child(3), .stats-table td:nth-child(3) {
    width: 300px;
}

.stats-table th:nth-child(4), .stats-table td:nth-child(4) {
    width: 400px;
}

.stats-table th:nth-child(5), .stats-table td:nth-child(5) {
    width: 200px;
}

.footer {
    background-image: linear-gradient(var(--contest-footer-dark), var(--contest-footer));
    color: #FFFFFF;
    padding: 10px 0 10px;
    position: relative;
    font-family: 'Roboto', Arial, sans-serif;
    background-size: cover;
    background-position: bottom;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0 30px;
}

.footer-column {
    flex: 2;
    min-width: 350px;
    margin: 15px;
    text-align: left;
}

    .footer-column.middle-column {
        flex: 3; /* Cột giữa có chiều rộng gấp đôi hai cột còn lại */
        min-width: 300px;
    }

    .footer-column.last-column {
        flex: 1; /* Cột giữa có chiều rộng gấp đôi hai cột còn lại */
        min-width: 200px;
    }

    .footer-column h4 {
        font-size: 18px;
        margin-bottom: 15px;
        position: relative;
        font-weight: 600;
        text-transform: uppercase;
    }

        .footer-column h4::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: -5px;
            width: 100px;
            height: 2px;
            background-color: var(--contest-accent);
        }

    .footer-column p {
        margin: 8px 0;
        font-size: 14px;
        line-height: 1.6;
        display: flex;
        align-items: center;
    }

    .footer-column i {
        margin-right: 10px;
        font-size: 16px;
        color: var(--contest-accent);
    }

    .footer-column a {
        color: #FFFFFF;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .footer-column a:hover {
            color: var(--contest-accent);
            text-decoration: underline;
        }

.contest-footer-developer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.contest-footer-logo {
    width: auto;
    height: 35px;
    flex: 0 0 auto;
    object-fit: contain;
}

.contest-back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
}

#divThongKeTruyCap .list-stats {
    list-style: none;
    padding: 0;
    margin: 0;
}

    #divThongKeTruyCap .list-stats li {
        margin: 8px 0;
        font-size: 14px;
        display: flex;
        align-items: center;
    }

    #divThongKeTruyCap .list-stats i {
        margin-right: 10px;
        font-size: 16px;
        color: var(--contest-accent);
    }

    #divThongKeTruyCap .list-stats .badge {
        background-color: var(--contest-accent);
        color: #B22222;
        font-weight: bold;
        padding: 3px 8px;
        border-radius: 10px;
        margin-left: 5px;
    }

@media (max-width: 768px) {
    .footer-column, .footer-column.middle-column, .footer-column.last-column {
        flex: 100%;
        width: 100%;
        min-width: 0;
        text-align: center;
        margin: 20px 0;
    }

        .footer-column h4::after {
            left: 50%;
            transform: translateX(-50%);
        }

        .footer-column p, #divThongKeTruyCap .list-stats li {
            justify-content: center;
        }

    .contest-footer-developer {
        justify-content: center;
    }

    .quiz-header h1 {
        font-size: 24px;
    }

    .countdown-container {
        padding: 20px;
        max-width: 100%;
    }

    .boxNgay, .boxGio, .boxPhut, .boxGiay {
        font-size: 28px;
        padding: 10px;
    }

    .cssTimeTable {
        max-width: 300px;
    }

    .countdown-title {
        font-size: 18px;
    }

    .contest-stats h3 {
        font-size: 22px;
    }

    .contest-stats .numLuot {
        font-size: 22px;
    }

    .btnContest {
        padding: 8px 18px;
        font-size: 13px;
    }

    .action-buttons {
        flex-direction: row; /* Nút nằm ngang */
        gap: 10px; /* Khoảng cách giữa các nút */
        align-items: center;
    }

    .btnContest {
        padding: 10px 20px; /* Tăng padding để nút to hơn */
        font-size: 20px; /* Giảm font-size để vừa với màn hình nhỏ */
        flex: 1; /* Các nút chia đều không gian */
        min-width: 120px; /* Đảm bảo nút không quá nhỏ */
        text-align: center;
    }

    .ads4-section {
        padding: 10px;
        margin-bottom: 20px;
    }

    .main-content .row {
        flex-direction: column;
    }

    .stats-section h3 {
        font-size: 24px;
    }

    .stats-table th, .stats-table td {
        font-size: 12px;
        padding: 10px;
    }

        .stats-table th:first-child, .stats-table td:first-child {
            width: 80px;
        }

        .stats-table th:nth-child(2), .stats-table td:nth-child(2) {
            width: 300px;
        }

        .stats-table th:nth-child(3), .stats-table td:nth-child(3) {
            width: 150px;
        }

    .footer .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer .footer-column {
        margin-bottom: 20px;
    }

        .footer .footer-column h4 {
            font-size: 15px;
        }

        .footer .footer-column p, .footer .footer-column a {
            font-size: 12px;
        }

        .footer .footer-column #divThongKeTruyCap {
            font-size: 12px;
            padding: 6px;
        }

    .footer .copyright {
        font-size: 12px;
    }

    .mobile-link {
        display: none;
    }

    .main-content .row {
        display: flex;
        align-items: stretch;
    }

    .ads4-section, .countdown-container {
        margin: 0;
    }
}

.bannerTop {
    width: 100%;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

    .bannerTop:hover {
        transform: scale(1.01);
    }

.stats-footer {
    margin-top: 15px;
    font-size: 15px;
    color: blue;
    text-align: right;
    font-style: italic;
}

@media (max-width: 480px) {
    .footer {
        padding: 0px 0 0px;
    }

    .container {
        padding: 0 0px;
    }

    .footer-column p, #divThongKeTruyCap .list-stats li {
        font-size: 13px;
    }
}

/* Khoảng cách */
.blank-20 {
    height: 20px;
}

.blank-10 {
    height: 10px;
}

.cssListHuyen {
    text-align: right;
    font-family: Times New Roman;
    font-size: 14px;
}

    .cssListHuyen a {
        color: blue;
        text-decoration: none;
    }

.cssListHuyen a:hover {
            color: darkred;
            text-decoration: none;
        }

/* Các tab chọn bảng thống kê công khai nằm ngoài iframe. */
.public-statistics {
    width: 100%;
    margin-top: 8px;
}

.public-statistics-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
}

.public-statistics-tab {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #eef3f8;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.public-statistics-tab:hover {
    border-color: var(--contest-border, #cbd5e1);
    color: var(--contest-statistics, #00529c);
    text-decoration: none;
}

.public-statistics-tab.is-active {
    border-color: var(--contest-statistics-tab, #0d65f2);
    background: var(--contest-statistics-tab, #0d65f2);
    color: #fff;
}

.public-statistics-tab:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.public-statistics-frame {
    display: block;
    width: 100%;
    height: 630px;
    border: 0;
    background: #fff;
}

@media (max-width: 620px) {
    .public-statistics-tabs {
        gap: 6px;
        padding: 8px 0;
    }

    .public-statistics-tab {
        min-height: 40px;
        flex: 1 1 145px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .public-statistics-frame {
        height: 650px;
    }
}
