/* ========================================
   Google Play Store Style - Game Store
   Modern, Clean, Professional Design
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* Play Store Colors */
    --primary-color: #01875f;
    --primary-dark: #016847;
    --primary-light: #e8f5e9;
    --accent-color: #1a73e8;
    
    /* Text Colors */
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    
    /* Border & Divider */
    --border-color: #dadce0;
    --divider-color: #e8eaed;
    
    /* Shadows - Play Store Style */
    --shadow-1: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --shadow-2: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
    --shadow-3: 0 2px 6px 2px rgba(60,64,67,.15), 0 8px 24px 4px rgba(60,64,67,.15);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

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

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

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

/* ========================================
   HEADER - PLAY STORE STYLE
   ======================================== */

header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logo-icon {
    font-size: 28px;
}

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

.search-container {
    flex: 1;
    max-width: 720px;
}

.search-form {
    display: flex;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 12px 52px 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    background: var(--bg-primary);
    box-shadow: var(--shadow-2);
    border-color: var(--primary-color);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 20px;
    background: var(--primary-color);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
}

.search-btn:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-1);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

/* ========================================
   CATEGORIES - HORIZONTAL CHIPS
   ======================================== */

.categories-section {
    background: var(--bg-primary);
    padding: 16px 0;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.categories-section::-webkit-scrollbar {
    height: 6px;
}

.categories-section::-webkit-scrollbar-track {
    background: transparent;
}

.categories-section::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.categories-list {
    display: flex;
    gap: 8px;
    padding: 0 24px;
    list-style: none;
}

.category-item {
    flex-shrink: 0;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.category-chip.active {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
}

/* ========================================
   PAGE HEADER
   ======================================== */

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   GAMES GRID - PLAY STORE CARDS
   ======================================== */

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

.game-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(1, 135, 95, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.game-card:hover::before {
    opacity: 1;
}

.game-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-card-inner {
    padding: 16px;
}

.game-icon-container {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-1);
    background: var(--bg-secondary);
}

.game-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover .game-icon {
    transform: scale(1.05);
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.8em;
}

.game-developer {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.star-icon {
    color: #fbbc04;
    font-size: 16px;
}

.stars {
    color: #fbbc04;
}

.game-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.game-downloads {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.2;
    color: var(--text-secondary);
}

.empty-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 48px 0;
}

.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    font-size: 14px;
}

.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
}

.pagination .disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: var(--bg-primary);
    padding: 32px 24px;
    margin-top: 48px;
    border-top: 1px solid var(--divider-color);
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
}

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

/* ========================================
   LOADING & STATES
   ======================================== */

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo-icon {
        font-size: 24px;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        max-width: 100%;
    }
    
    .search-input {
        padding: 10px 48px 10px 16px;
        font-size: 15px;
    }
    
    .search-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .container {
        padding: 16px;
    }
    
    .categories-section {
        margin-bottom: 16px;
    }
    
    .categories-list {
        padding: 0 16px;
    }
    
    .category-chip {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .page-header {
        margin-bottom: 20px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .page-subtitle {
        font-size: 13px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px 12px;
    }
    
    .game-card-inner {
        padding: 12px;
    }
    
    .game-icon-container {
        margin-bottom: 10px;
        border-radius: var(--radius-md);
    }
    
    .game-title {
        font-size: 14px;
        min-height: 2.6em;
    }
    
    .game-developer {
        font-size: 12px;
    }
    
    .game-meta {
        margin-top: 6px;
        gap: 6px;
    }
    
    .game-rating,
    .game-downloads {
        font-size: 12px;
    }
    
    .game-category {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .pagination {
        gap: 6px;
        margin: 32px 0;
    }
    
    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 10px 12px;
    }
    
    .container {
        padding: 12px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 8px;
    }
    
    .game-card-inner {
        padding: 10px;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

html {
    scroll-behavior: smooth;
}

::selection {
    background: var(--primary-color);
    color: var(--bg-primary);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

.game-card {
    animation: fadeIn 0.3s ease-out;
}

.game-card:nth-child(n) {
    animation-delay: calc(0.05s * var(--index, 0));
}

/* Smooth all transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent transition on page load */
.preload * {
    transition: none !important;
}
