/**
 * Theme Name: GameBox (HTML5 Modern Portal)
 * Theme URI: http://gamebox.local
 * Description: High-energy coral & teal gaming theme with category pill tabs, featured & all games grids, pre-populated recently played section, favorites drawer, and AdSense readiness.
 * Author: PlayArcade Pro
 * Version: 2.5.0
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #FF6B6B;
    --primary-hover: #e05555;
    --secondary: #4ECDC4;
    --dark: #161b21;
    --light: #F7FFF7;
    --accent: #FFE66D;
    --gray: #6C757D;
    --bg-body: #f8f9fa;
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header & Navigation */
header.site-header {
    background: linear-gradient(135deg, var(--primary), #FF8E8E);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo i {
    margin-right: 10px;
    color: var(--accent);
}

.logo img {
    height: 42px;
    width: auto;
    margin-right: 10px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    transform: translateY(-2px);
}

.nav-links i {
    margin-right: 8px;
    font-size: 1.1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(22, 27, 33, 0.82), rgba(22, 27, 33, 0.82)), 
                url('https://images.unsplash.com/photo-1542751371-adc38448a05e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 5rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-container {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.search-bar {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    outline: none;
    color: var(--dark);
    font-family: inherit;
}

.search-btn {
    padding: 0 1.8rem;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.search-btn:hover {
    background-color: var(--primary-hover);
}

/* Main Container & Sections */
.main-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* Category Filter Pills */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    padding: 0.6rem 1.3rem;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary);
    color: white !important;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.35);
}

/* Games Grid & Cards */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.game-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
}

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

.game-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e2e8f0;
}

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

.game-card:hover .game-thumbnail img {
    transform: scale(1.08);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    width: 58px;
    height: 58px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
}

.play-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover);
}

.game-info {
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-title a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.game-title a:hover {
    color: var(--primary);
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.game-category {
    font-size: 0.78rem;
    color: var(--gray);
    background: #f1f5f9;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-weight: 500;
}

.game-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--gray);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
}

.favorite-btn.favorited {
    color: var(--primary);
    background: rgba(255, 107, 107, 0.15);
}

/* Recently Played Section */
.recent-games {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.recent-list {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
}

.recent-list::-webkit-scrollbar {
    height: 6px;
}

.recent-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.recent-item {
    min-width: 180px;
    max-width: 200px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--dark);
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    border: 1px solid #eef2f6;
}

.recent-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

.recent-thumbnail {
    height: 115px;
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
}

.recent-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.recent-item:hover .recent-thumbnail img {
    transform: scale(1.06);
}

.recent-play {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.recent-item:hover .recent-play {
    opacity: 1;
}

.recent-play-btn {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.5);
}

.recent-info {
    padding: 0.9rem;
}

.recent-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-category {
    font-size: 0.74rem;
    color: var(--gray);
}

/* Category Sections */
.category-section {
    display: block;
}

.category-section.hidden {
    display: none;
}

/* Editorial & AdSense Overview Section */
.editorial-box {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    margin-top: 3.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.editorial-box h2 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 10px;
}

.editorial-box h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary);
}

.editorial-box p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.editorial-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.editorial-feat-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.editorial-feat-card h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editorial-feat-card p {
    margin-bottom: 0;
    font-size: 0.88rem;
    color: #64748b;
}

/* Footer Section */
footer {
    background-color: var(--dark);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-column h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    color: white;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary);
}

.footer-column p {
    color: #adb5bd;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    text-decoration: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-4px);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #adb5bd;
    font-size: 0.9rem;
}

/* Scoped Inner Pages Styling (Game, Category, Pages, Contact) */
.inner-page-wrapper {
    max-width: 1200px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
}

.game-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.game-breadcrumbs a {
    color: var(--primary);
    font-weight: 500;
}

.game-breadcrumbs .bc-sep {
    opacity: 0.5;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, var(--primary), #FF8E8E);
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        padding: 1.5rem 0;
        display: none;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        z-index: 999;
    }
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }
    .nav-links li {
        margin: 0;
    }
    .mobile-menu-btn {
        display: block;
    }
    .hero {
        padding: 3.5rem 1rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .play-btn {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .navbar {
        padding: 0 1rem;
    }
    .games-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    .game-info {
        padding: 0.8rem;
    }
    .game-title {
        font-size: 0.92rem;
    }
    .game-category {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    .recent-item {
        min-width: 150px;
    }
    .recent-thumbnail {
        height: 95px;
    }
}
