.gls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.gls-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.gls-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.gls-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.gls-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

/* Media query cho tablet (768px–1024px) */
@media screen and (max-width: 1024px) {
    .gls-grid,
    .gls-grid[data-columns="2"],
    .gls-grid[data-columns="3"],
    .gls-grid[data-columns="4"],
    .gls-grid[data-columns="5"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Media query cho mobile (dưới 768px) */
@media screen and (max-width: 768px) {
    .gls-grid,
    .gls-grid[data-columns="2"],
    .gls-grid[data-columns="3"],
    .gls-grid[data-columns="4"],
    .gls-grid[data-columns="5"] {
        grid-template-columns: 1fr; /* 1 cột trên mobile */
    }
    .gls-grid[data-aspect-ratio="square"] .gls-card img {
        max-width: 150px; /* Tăng kích thước ảnh vuông trên mobile */
    }
    .gls-grid[data-aspect-ratio="landscape"] .gls-card img {
        max-width: 280px; /* Tăng kích thước ảnh ngang trên mobile */
    }
}

.gls-card {
    border: 1px solid #e0e0e0;
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    position: relative;
}

.gls-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.gls-grid[data-aspect-ratio="square"] .gls-card img {
    width: 100%;
    max-width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.gls-grid[data-aspect-ratio="landscape"] .gls-card img {
    width: 100%;
    max-width: 240px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.gls-card h3 {
    font-size: 16px;
    margin: 10px 0;
    color: #222;
    line-height: 1.4;
    font-weight: 600;
}

.gls-card .gls-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    flex-wrap: nowrap; /* Đảm bảo ngày và lượt tải cùng hàng */
    gap: 15px;
}

.gls-card .gls-date {
    background: linear-gradient(135deg, #f0f4ff, #e0e7ff);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    color: #1e40af;
    transition: transform 0.2s ease, background 0.2s ease;
    line-height: 1.5; /* Đảm bảo căn chỉnh dọc */
}

.gls-card .gls-date:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #dbe9ff, #c3d7ff);
}

.gls-card .gls-downloads {
    background: linear-gradient(135deg, #e6fffa, #d1fae5);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    color: #065f46;
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px; /* Khoảng cách giữa biểu tượng và số */
    font-size: 13px; /* Kích thước chữ đồng nhất */
    line-height: 1.5; /* Căn chỉnh dọc đồng nhất với .gls-date */
}

.gls-card .gls-downloads:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ccfbf1, #b5f5d8);
}

.gls-card .gls-card-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    justify-content: flex-end;
}

.gls-card .gls-overlay-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.gls-card .gls-tag {
    display: block;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
}

.gls-card .gls-platforms {
    display: block;
}

.gls-card .gls-platform {
    display: block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    margin-bottom: 5px;
    text-decoration: none;
    transition: opacity 0.2s ease-in-out;
}

.gls-card .gls-platform:hover {
    opacity: 0.8;
    cursor: pointer;
}

.gls-platform-pc {
    background: #dc3545;
}

.gls-platform-android {
    background: #ff6200;
}

.gls-platform-ios {
    background: #007bff;
}

.gls-tag.news {
    background: #28a745;
}

.gls-tag.update {
    background: #007bff;
}

.gls-pagination {
    text-align: center;
    margin-top: 20px;
}

.gls-pagination a, .gls-pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #f8f9fa;
    transition: background 0.2s;
}

.gls-pagination a:hover {
    background: #007bff;
    color: #fff;
}

.gls-pagination .current {
    background: #007bff;
    color: #fff;
    font-weight: bold;
}

/* CSS cho quảng cáo nổi bật */
.gls-ad-banner {
    background: linear-gradient(90deg, #ff6200, #007bff);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 1s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gls-ad-banner span {
    display: inline-flex;
    align-items: center;
}

.gls-ad-banner span::before {
    content: '🔻';
    margin-right: 8px;
    font-size: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}