/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800;900&display=swap');

:root {
    --bg-color: #f4f7fb; /* Light grayish blue background */
    --surface-color: #ffffff; /* Pure white surface */
    --surface-hover: #f8fafc;
    --primary-color: #2563eb; /* Blue 600 */
    --primary-hover: #1d4ed8;
    --accent-color: #7c3aed; /* Violet 600 */
    --accent-hover: #6d28d9;
    --text-main: #1e293b; /* Dark slate */
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-blur: blur(16px);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 15px 30px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-neon: 0 0 20px rgba(37, 99, 235, 0.3);
    --shadow-neon-accent: 0 0 20px rgba(124, 58, 237, 0.3);
    
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color); 
}
::-webkit-scrollbar-thumb {
    background: var(--surface-hover); 
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color); 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.05), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(124, 58, 237, 0.05), transparent 40%);
    background-attachment: fixed;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(270deg, #ff0040, #ff7f00, #ff0040, #00ffea, #8b5cf6, #ff0040);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    animation: rgbRunning 8s ease infinite;
    text-transform: uppercase;
}

@keyframes rgbRunning {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 30px;
}

.search-bar input {
    width: 100%;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: var(--shadow-neon);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

.mobile-actions {
    display: none;
}

@media (max-width: 768px) {
    .nav-wrapper {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0;
    }
    
    .mobile-actions {
        display: flex;
        align-items: center;
        gap: 15px;
        order: 2;
    }
    
    .mobile-actions button {
        background: none;
        border: none;
        color: var(--text-main);
        cursor: pointer;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.2s;
    }
    
    .mobile-actions button:hover {
        color: var(--primary-color);
    }
    
    .logo {
        order: 1;
        font-size: 24px;
    }
    
    .nav-links {
        order: 4;
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
        display: none;
        border-top: 1px solid var(--border-color);
        margin-top: 15px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 15px 0 0 0;
        display: none;
    }
    
    .search-bar.active {
        display: block;
    }
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--primary-color);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Showcase (Carousel) */
.hero-showcase {
    display: flex;
    gap: 20px;
    margin: 40px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 20px;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.hero-showcase::-webkit-scrollbar {
    display: none;
}

.hero-showcase-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    display: block;
    flex: 0 0 calc(33.333% - 14px);
    scroll-snap-align: start;
    aspect-ratio: 16/10;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 992px) {
    .hero-showcase-card {
        flex: 0 0 calc(50% - 10px);
    }
}
@media (max-width: 768px) {
    .hero-showcase-card {
        flex: 0 0 100%;
    }
}

.hero-showcase-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
}

.hero-showcase-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 5s ease;
}

.hero-showcase-card:hover .hero-showcase-img {
    transform: scale(1.05);
}

.hero-showcase-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 30px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.hero-showcase-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero-showcase-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    pointer-events: auto;
    transition: background 0.2s ease, color 0.2s ease;
}
.nav-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    border-radius: var(--radius-full);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-neon-accent);
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 60px 0 30px 0;
}

.section-title h2 {
    font-size: 28px;
    font-weight: 800;
    position: relative;
    padding-left: 20px;
}

.section-title h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 6px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-full);
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 1100px) { .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .game-grid { grid-template-columns: minmax(0, 1fr); } }

/* Game Card (Reference Style) */
.game-card {
    position: relative;
    border-radius: 0;
    overflow: visible;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: none;
    background: transparent;
    animation: fadeInUp 0.5s ease-out backwards;
    min-width: 0; /* Ensures content doesn't break grid column width */
}

/* Stagger card animations */
.game-grid .game-card:nth-child(1) { animation-delay: 0.1s; }
.game-grid .game-card:nth-child(2) { animation-delay: 0.2s; }
.game-grid .game-card:nth-child(3) { animation-delay: 0.3s; }
.game-grid .game-card:nth-child(4) { animation-delay: 0.4s; }
.game-grid .game-card:nth-child(5) { animation-delay: 0.5s; }
.game-grid .game-card:nth-child(6) { animation-delay: 0.6s; }

.game-card:hover {
    transform: translateY(-4px);
}

.game-thumb {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
    z-index: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.game-card:hover .game-thumb {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.game-card::after {
    display: none;
}

.game-info {
    position: relative;
    padding: 10px 4px 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.game-card:hover .game-info {
    background: transparent;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.rgb-text {
    background: linear-gradient(
        to right,
        #ff0000,
        #ff7f00,
        #ffff00,
        #00ff00,
        #0000ff,
        #4b0082,
        #8b00ff,
        #ff0000
    );
    background-size: 200% auto;
    color: #000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rgb-running 3s linear infinite;
}

@keyframes rgb-running {
    to {
        background-position: 200% center;
    }
}

.game-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: auto;
    font-weight: 600;
}

/* Categories Badge */
.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    z-index: 10;
    box-shadow: var(--shadow-sm);
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-link:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.page-link.active {
    background: var(--primary-color);
    color: #ffffff;
}

/* Footer */
footer {
    margin-top: 100px;
    padding: 60px 0 40px;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    backdrop-filter: var(--glass-blur);
}

footer p {
    margin-bottom: 12px;
    font-size: 15px;
}

.footer-links a {
    color: var(--text-muted);
    margin: 0 15px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-wrapper {
        flex-wrap: wrap;
        gap: 15px;
    }
    .search-bar {
        order: 3;
        max-width: 100%;
        margin: 0;
    }
    .premium-hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
    .hero-content {
        width: 100%;
        max-width: 100%;
        margin-bottom: 40px;
    }
    .hero-title {
        font-size: 36px;
    }
    .hero-desc {
        max-width: 100%;
        font-size: 16px;
    }
    .hero-actions {
        justify-content: center;
        flex-direction: column;
        gap: 15px;
    }
    .hero-btn {
        width: 100%;
        max-width: 300px;
    }
    .hero-image-wrapper {
        width: 100%;
        justify-content: center;
    }
    .hero-floating-img {
        max-width: 80%;
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    .game-card::after {
        display: none; /* Disable hover icon on mobile */
    }
}
