/* ===== BestGameY2Y - Game Portal Styles ===== */

/* CSS Variables - Apple-inspired Design System */
:root {
    --primary: #0071e3;
    --primary-hover: #0077ed;
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-dark: #1d1d1f;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-light: #f5f5f7;
    --border-color: #d2d2d7;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo span {
    color: var(--primary);
}

/* Navigation */
.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 20px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

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

/* ===== Categories Section ===== */
.categories {
    padding: 60px 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Games Grid ===== */
.games-section {
    padding: 60px 0;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.game-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.game-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-info {
    padding: 16px;
}

.game-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.game-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.game-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fbbf24;
    font-weight: 600;
}

.play-btn {
    padding: 8px 20px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
}

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

/* ===== Game Detail Page ===== */
.game-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 40px 0;
}

.game-frame-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.game-frame-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-primary);
}

.fullscreen-btn {
    padding: 10px 20px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    opacity: 0.8;
}

/* ===== Game Info Section ===== */
.game-detail-info {
    padding: 60px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.info-main h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.info-main p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.controls-list {
    list-style: none;
}

.controls-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.controls-list li:last-child {
    border-bottom: none;
}

.key-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-weight: 600;
}

/* ===== Sidebar ===== */
.info-sidebar {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* ===== Social Share ===== */
.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.facebook {
    background: #4267b2;
}

.share-btn.reddit {
    background: #ff4500;
}

.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ===== Rating ===== */
.rating-container {
    text-align: center;
}

.stars {
    font-size: 2rem;
    margin-bottom: 8px;
}

.star {
    cursor: pointer;
    color: #d1d5db;
    transition: var(--transition);
}

.star.active, .star:hover {
    color: #fbbf24;
}

.rating-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Related Games ===== */
.related-games {
    padding: 60px 0;
    background: var(--bg-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 20px;
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 16px;
    }
    
    .nav.active {
        display: flex;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-container {
        width: 100%;
        max-width: none;
        margin: 16px 0 0;
        order: 3;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }

/* ===== Loading Placeholder ===== */
.placeholder-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}
