/* ============================================================
   DARK MODE - GAMING FLAT THEME
   Deep background (#212121), Elevated Cards (#313131), Candy Red Accent
   ============================================================ */

/* ----- Reset & Base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Updated dark colors and Candy Red accent */
    --bg-primary: #212121;        
    --bg-secondary: #212121;
    --bg-card: #313131;
    --bg-elevated: #3d3d3d;
    --bg-glass: rgba(33, 33, 33, 0.85);
    --text-primary: #edf2f7;      
    --text-secondary: #b3b3b3;    
    --text-muted: #888888;
    --accent: #ff0800;             /* Candy Red */
    --accent-light: rgba(255, 8, 0, 0.15);
    --accent-hover: #ff3333;
    --accent-glow: rgba(255, 8, 0, 0.12);
    --border: #424242;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 20px 32px -12px rgba(255, 8, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.2);
    --transition-default: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 25% 40%, rgba(255, 8, 0, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 80px;
    font-weight: 450;
    letter-spacing: -0.01em;
}

/* ----- Container refinement ----- */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ========== HEADER - Dark Glassmorphism ========== */
.header {
    background: rgba(33, 33, 33, 0.85);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-default);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 620;
    text-decoration: none;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #ff0800 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.logo span {
    background: linear-gradient(135deg, #ff0800, #ff4d4d);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: 500;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.lang-toggle {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition-default);
    backdrop-filter: blur(4px);
}

.lang-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== MAIN CONTENT ========== */
.main {
    padding: 48px 0 32px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 4px;
}

.game-section {
    margin-bottom: 56px;
}

/* ========== GAME GRID ========== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* ========== GAME CARD - Dark Premium ========== */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0;
    cursor: pointer;
    transition: var(--transition-default);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--card-hover-shadow);
    background: var(--bg-elevated);
}

/* Subtle accent line on hover */
.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.game-card:hover::after {
    opacity: 1;
}

/* Game Image Container */
.game-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    position: relative;
    background: linear-gradient(145deg, #313131, #212121);
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .game-image img {
    transform: scale(1.03);
}

/* Fallback icon styling */
.game-icon-fallback {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: var(--accent);
    opacity: 0.6;
}

.game-image.no-image .game-icon-fallback {
    display: block;
}

.game-image.no-image img {
    display: none;
}

/* Game Info Section */
.game-info {
    padding: 18px 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-icon {
    display: none;
}

.game-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.game-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 450;
}

/* ========== CLEAN & NEUTRAL TAGS (HINDI MASAKIT SA MATA) ========== */
.game-tags {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 500;
    color: #b3b3b3; /* Neutral Light Gray - hindi red */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-default);
}

.game-card:hover .tag {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff; /* Pumuputi kapag tinapatan ng mouse */
}

/* Lahat ng badges naka-neutralize para malinis tignan */
.badge-coop, .badge-pvp {
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cccccc !important;
}

.badge-diskless-only, .badge-diskless-trad {
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #999999 !important;
}

.badge-size {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important; /* Mas maputi para kitang-kita ang size */
}

/* ========== PRICE TAG (STEALTH MODE) ========== */
.price-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05); /* Dark gray background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff; /* Puti ang text ng presyo */
    margin-top: 10px;
    width: fit-content;
    letter-spacing: 0.2px;
    transition: var(--transition-default);
}

.game-card:hover .price-tag {
    background: var(--bg-elevated);
    border-color: #666666;
}

/* ========== SEARCH BAR - Dark Glassmorphism ========== */
.search-container {
    margin-bottom: 36px;
    display: flex;
    justify-content: flex-end;
}

#searchInput {
    width: 100%;
    max-width: 320px;
    padding: 12px 20px;
    border-radius: 48px;
    border: 1px solid var(--border);
    background: rgba(49, 49, 49, 0.85);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 450;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(255, 8, 0, 0.2);
    background: var(--bg-card);
}

#searchInput::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* ========== UPDATE NOTICE ========== */
.update-notice {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

/* ========== FOOTER - Dark Fixed & Refined ========== */
.footer {
    background: rgba(33, 33, 33, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 100;
    font-weight: 450;
    letter-spacing: 0.2px;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 900px) {
    .container {
        padding: 0 24px;
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 18px;
    }
    .nav-links a {
        font-size: 0.7rem;
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    .section-title {
        font-size: 1.4rem;
    }
    .game-image {
        height: 110px;
    }
    .game-info {
        padding: 14px 12px 16px;
    }
    .game-card h3 {
        font-size: 0.85rem;
    }
    .tag {
        font-size: 0.6rem;
        padding: 2px 8px;
    }
    .search-container {
        justify-content: center;
        margin-bottom: 28px;
    }
    #searchInput {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }
    .logo {
        font-size: 1.4rem;
    }
    .container {
        padding: 0 18px;
    }
    .game-grid {
        gap: 12px;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .game-image {
        height: 95px;
    }
    .price-tag {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
}

/* ========== ADDITIONAL POLISH ========== */
::selection {
    background: var(--accent);
    color: #0a0f14;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
}

.game-card,
.tag,
.lang-toggle,
#searchInput,
.nav-links a {
    transition: var(--transition-default);
}

/* Pagination Controls */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#paginationControlsTop {
    margin-top: 10px;
    margin-bottom: 24px;
}

.page-btn {
    background: rgba(49, 49, 49, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 8, 0, 0.2);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover:not(.disabled) {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 8, 0, 0.4);
    background: rgba(255, 8, 0, 0.1);
}

.page-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 8, 0, 0.6);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border);
}

/* Total Games Counter */
.total-count {
    font-size: 16px;
    color: var(--accent); 
    font-weight: normal;
    margin-left: 10px;
    letter-spacing: 0;
    opacity: 0.8;
}
