@font-face {
    font-family: 'Pony';
    src: url('Pony.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    color: #FFFFCC;
    z-index: 2000;
}
.close-btn:hover {
    color: #ff0000;
}
.toggle-button {
    position: fixed;
    top: 50px;
    left: 10px;
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 2000;
}
.toggle-button:hover {
    background: linear-gradient(135deg, #66FF00, #00FF00);
}
.toggle-stats-visibility {
    position: fixed;
    bottom: 90px;
    left: 0px;
    padding: 8px 15px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.toggle-stats-visibility:hover {
    background-color: #d35400;
}
.instruction {
    font-size: 12px;
    color: #666;
    position: absolute;
    top: 85px;
    left: 15px;
    transition: background-color 0.3s ease;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: Arial, sans-serif;
    background-image: radial-gradient(circle farthest-corner at 7.2% 13.6%, rgba(37, 249, 245, 1) 0%, rgba(8, 70, 218, 1) 90%);
    color: #333;
    padding: 20px;
    text-align: center;
    min-height: 100vh;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    user-select: none;
}
h1 {
    font-size: 2.5em;
    color: #34495e;
    margin-bottom: 20px;
}
.click-stats {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 20px;
    margin: 0 auto 30px;
    max-width: 1400px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: none;
    border: 2px solid #74b9ff;
}
.click-stats h2 {
    font-size: 1.8em;
    color: #2ecc71;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-family: 'Pony', Arial, sans-serif;
}
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}
.stats-table {
    flex: 1;
    min-width: 0;
}
.click-stats table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9em;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.click-stats th, .click-stats td {
    padding: 12px;
    border: 1px solid #e0e0e0;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.click-stats th {
    background: linear-gradient(135deg, #74b9ff, #3498db);
    color: blue;
    font-weight: 600;
    font-family: Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.click-stats th:nth-child(1), .click-stats td:nth-child(1) {
    width: 50px;
    background: #dfeffa;
    color: #2c3e50;
    font-weight: 600;
}
.click-stats th:nth-child(2), .click-stats td:nth-child(2) {
    width: 250px;
    background: #f9f9f9;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.click-stats th:nth-child(3), .click-stats td:nth-child(3) {
    width: 80px;
    background: #fff8e1;
    color: #c0392b;
    font-weight: 600;
}
.click-stats tr:nth-child(even) {
    background-color: #f5f6fa;
}
.click-stats tr:hover {
    background-color: #e0f7fa;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}
.stats-card-link {
    color: #2980b9;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
    display: inline-block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    cursor: pointer; /* Thêm con trỏ bàn tay khi hover */
}
.stats-card-link:hover {
    color: #e74c3c;
    text-decoration: underline;
}
.stats-card-link:active {
    color: #c0392b;
}
.toggle-stats-btn {
    margin-bottom: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease;
}
.toggle-stats-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1b263b);
    transform: scale(1.05);
}
.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}
.card {
    flex: 0 0 calc(20% - 16px);
    min-width: 200px;
    max-width: 250px;
    border: 2px solid #74b9ff;
    border-radius: 15px;
    background-color: #FFFFCC;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    transform: translateY(50px);
    cursor: pointer;
}
.card.visible {
    opacity: 1;
    transform: translateY(0);
}
.card:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #e74c3c; /* Change border color to red on hover, keep thickness at 2px */
}
.card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.card:hover img {
    animation: scrollImg 1s forwards;
}
.card-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px; /* Matches slide distance for full visibility */
    background: #0066FF; /* Semi-transparent background */
    color: #ffffff;
    font-size: 0.9em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 1; /* Below overlay but above image */
    opacity: 0; /* Hidden initially */
    transition: opacity 0.3s ease;
}
.card:hover .card-text {
    opacity: 1; /* Show text on hover */
}
@keyframes scrollImg {
    0% { transform: translateY(0px); }
    100% { transform: translateY(40px); } /* Slide image down */
}
.card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1em;
    text-transform: uppercase;
}
.card:hover .overlay {
    opacity: 1;
}
.card:hover img {
    opacity: 0.7;
}
.card .category {
    padding: 2px;
    color: #34495e;
    font-size: 1em;
    text-align: center;
    background-color: #fff;
    position: relative;
    white-space: nowrap;
}
.card .text {
    padding: 8px;
    color: #666;
    font-size: 0.9em;
}
.content-area {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #fff;
    z-index: 1000;
}
.content-area.active {
    display: block;
}
.content-area iframe {
    width: 100vw;
    height: 100vh;
    border: none;
    margin: 0;
    padding: 0;
}
.home-button {
    position: fixed;
    top: 100px;
    left: 10px;
    padding: 10px 20px;
    background-image: radial-gradient(circle farthest-corner at 7.2% 13.6%, rgba(178 34 34) 0%, rgba(238 44 44) 90%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 2000;
}
.home-button:hover {
    background: linear-gradient(135deg, #008080, #0000FF);
}
.home2-button {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 10px 20px;
    background-image: radial-gradient(circle farthest-corner at 7.2% 13.6%, rgba(37, 249, 245, 1) 0%, rgba(8, 70, 218, 1) 90%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 2000;
}
.home2-button:hover {
    background: linear-gradient(135deg, #66FF00, #00FF00);
}
.truong-button {
    position: fixed;
    bottom: 0px;
    left: 0px;
    width: 100px;
    height: 80px;
    padding: 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 2000;
    overflow: hidden;
}
.truong-button a {
    display: block;
    width: 100%;
    height: 100%;
}
.truong-button img {
    width: 100px;
    height: 80px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}
.truong-button .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7em;
    font-family: Arial, sans-serif;
    text-align: center;
}
.truong-button:hover .overlay {
    opacity: 1;
}
.truong-button:hover img {
    transform: scale(1.1);
    opacity: 0.7;
}
#total-clicks {
    margin-top: 20px;
    font-size: 1.2em;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 10;
}
@media (max-width: 1200px) {
    .card {
        flex: 0 0 calc(25% - 15px);
        min-width: 180px;
    }
    .card img { height: 100px; }
    .card .overlay { font-size: 0.9em; }
    .card .category { font-size: 0.8em; padding: 6px; }
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .click-stats th:nth-child(2), .click-stats td:nth-child(2) {
        width: 200px;
    }
}
@media (max-width: 768px) {
    .card {
        flex: 0 0 calc(33.33% - 13.33px);
        min-width: 140px;
    }
    .card img { height: 80px; }
    .card .overlay { font-size: 0.8em; }
    .card .category { font-size: 0.7em; padding: 5px; }
    .click-stats { max-width: 100%; }
    .stats-container {
        grid-template-columns: 1fr;
    }
    .click-stats th, .click-stats td {
        padding: 8px;
        font-size: 0.85em;
    }
    .click-stats th:nth-child(2), .click-stats td:nth-child(2) {
        width: 150px;
    }
}
@media (max-width: 480px) {
    .card {
        flex: 0 0 100%;
        max-width: 200px;
        height: auto;
    }
    .card img { height: 120px; }
    .card .category { font-size: 0.9em; padding: 8px; }
    .click-stats { padding: 10px; }
    .click-stats th, .click-stats td { padding: 8px; font-size: 0.9em; }
}
a {
    color: #ffffff;
    text-decoration: none;
}
a:visited { color: #ffffff; }
a:hover { color: #ff5733; }
a:active { color: #007bff; }
.card-link {
    pointer-events: auto;
}
.card-link[href]:hover:after {
    content: "";
    display: none;
}
.new-badge {
    width: 40px !important;
    height: 40px !important;
    max-width: 45px;
    max-height: 45px;
    vertical-align: middle;
    margin-right: 5px;
    transition: opacity 0.3s ease;
    object-fit: contain;
}
.new-badge.hidden {
    opacity: 0;
    pointer-events: none;
}
.card-number {
    font-weight: bold;
    color: #e74c3c;
    margin-right: 5px;
}
.open-link {
    display: block;
    padding: 5px;
    color: #3498db;
    font-size: 0.8em;
    text-align: center;
    cursor: pointer;
}
.open-link:hover {
    color: #2980b9;
    text-decoration: underline;
}