/* Game Listing Styles - Tương tự như hình ảnh ROBLOX GAME CODES */
.game-listing-container {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.game-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-listing-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-label {
    color: #cccccc;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
}

/* Custom Dropdown Styles */
.custom-select-wrapper {
    position: relative;
    min-width: 120px;
}

.custom-select-trigger {
    background-color: #2a2a2a;
    border: 1px solid #555;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    height: 28px;
    line-height: 1;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.custom-select-trigger:hover {
    background-color: #3a3a3a;
    border-color: #666;
}

.custom-select-trigger:focus {
    outline: none;
    border-color: #ff4444;
}

.custom-select-trigger .tsi {
    font-size: 10px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.custom-select-wrapper.active .custom-select-trigger .tsi {
    transform: rotate(180deg);
}

.custom-select-value {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    z-index: 1000;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Custom scrollbar for dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.custom-select-wrapper.active .custom-select-dropdown {
    display: block;
}

.custom-select-option {
    padding: 6px 10px;
    font-size: 12px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #333;
    line-height: 1.3;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background-color: #3a3a3a;
}

.custom-select-option.selected {
    background-color: #ff4444;
    color: #ffffff;
}

.custom-select-option.selected:hover {
    background-color: #ff5555;
}

/* Hide native select */
.game-genre-select,
.game-sort-select {
    display: none !important;
}

.game-listing-header .heading {
    color: rgb(240, 240, 240) !important;
}

.view-all-link {
    color: rgb(205, 205, 205);
    text-decoration: none;
    font-weight: 550;
    font-size: 13px;
}

.view-all-link:hover {
    color: #fff;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background-color: #2a2a2a;
    border: 1px solid #666;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-2px);
    border-color: #888;
}

.game-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.game-thumbnail {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-thumbnail {
    width: 100%;
    height: 100%;
    background-color: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 14px;
}

.game-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    padding: 15px 15px 10px;
    line-height: 1.3;
    margin: 0;
}

.game-status-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 15px;
}

.game-meta {
    display: flex;
    font-size: 0.95em;
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.see-all-codes-btn {
    width: 100%;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 550;
    background-color: rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.see-all-codes-btn:hover {
    color: #ffffff;
    background-color: var(--c-main);
}

.status-views {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Rank colors theo theme style */
.status-views.rank-hot {
    color: #ed6d08;
}

.status-views.rank-hot .views-value {
    color: #ed6d08;
}

.status-views.rank-trend {
    color: #f73f20;
}

.status-views.rank-trend .views-value {
    color: #f73f20;
}

.status-views.rank-viral {
    color: #ff0000;
}

.status-views.rank-viral .views-value {
    color: #ff0000;
}

/* Pagination Styles */
.game-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-btn {
    background-color: #3a3a3a;
    border: 1px solid #555;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #4a4a4a;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-number {
    background-color: #3a3a3a;
    border: 1px solid #555;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-number:hover {
    background-color: #4a4a4a;
}

.pagination-number.active {
    background-color: #ff4444;
    border-color: #ff4444;
}

.pagination-ellipsis {
    color: #888;
    padding: 8px 4px;
}

/* Loading State */
.game-listing-loading {
    opacity: 0.6;
    pointer-events: none;
}

.game-listing-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading */
.skeleton {
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-thumbnail {
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    height: 150px;
    border-radius: 6px;
}

.skeleton-title {
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    height: 20px;
    width: 80%;
    margin: 15px auto;
    border-radius: 4px;
}

.skeleton-status {
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    height: 16px;
    width: 100%;
    margin: 8px 0;
    border-radius: 3px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Error Message */
.error-message {
    text-align: center;
    color: #ff4444;
    padding: 40px 20px;
    font-size: 16px;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #ff4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .game-listing-title {
        font-size: 24px;
    }

    .game-thumbnail {
        height: 150px;
    }

    .game-status-info {
        flex-wrap: wrap;
        gap: 8px;
    }

    .see-all-codes-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-listing-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .game-listing-controls {
        width: 100%;
        align-items: stretch;
    }

    .control-row {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .control-group {
        width: 100%;
    }

    .game-genre-select,
    .game-sort-select {
        width: 100%;
    }

    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-number {
        min-width: 35px;
        padding: 6px 8px;
    }
}