/**
 * PGStats Main Stylesheet
 * All classes use 'pg2a-' prefix for namespace isolation
 * Mobile-first responsive design
 */

/* CSS Variables */
:root {
    --pg2a-primary: #D4AF37;
    --pg2a-secondary: #BC8F8F;
    --pg2a-bg: #262626;
    --pg2a-bg-light: #333333;
    --pg2a-text: #FFDEAD;
    --pg2a-text-light: #F0E68C;
    --pg2a-accent: #D4AF37;
    --pg2a-success: #4CAF50;
    --pg2a-border: #444444;
    --pg2a-shadow: rgba(0, 0, 0, 0.3);
}

/* Base Styles */
html {
    font-size: 62.5%;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--pg2a-bg);
    color: var(--pg2a-text);
    line-height: 1.5;
    font-size: 1.4rem;
    min-height: 100vh;
}

a {
    color: var(--pg2a-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--pg2a-primary);
}

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

/* Container */
.pg2a-container {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.pg2a-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--pg2a-bg) 0%, var(--pg2a-bg-light) 100%);
    border-bottom: 1px solid var(--pg2a-border);
    z-index: 1000;
    padding: 0.8rem 0;
}

.pg2a-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    max-width: 430px;
    margin: 0 auto;
}

.pg2a-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pg2a-logo img {
    width: 28px;
    height: 28px;
}

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

.pg2a-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pg2a-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 0.4rem;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-height: 36px;
    min-width: 44px;
}

.pg2a-btn-primary {
    background: linear-gradient(135deg, var(--pg2a-primary) 0%, #c9a227 100%);
    color: var(--pg2a-bg);
}

.pg2a-btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--pg2a-shadow);
}

.pg2a-btn-outline {
    background: transparent;
    border: 2px solid var(--pg2a-primary);
    color: var(--pg2a-primary);
}

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

.pg2a-menu-toggle {
    background: none;
    border: none;
    color: var(--pg2a-text);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Menu */
.pg2a-mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--pg2a-bg);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

.pg2a-menu-open {
    right: 0;
}

.pg2a-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pg2a-overlay-active {
    opacity: 1;
    visibility: visible;
}

.pg2a-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--pg2a-border);
}

.pg2a-menu-close {
    background: none;
    border: none;
    color: var(--pg2a-text);
    font-size: 2.4rem;
    cursor: pointer;
}

.pg2a-menu-links {
    list-style: none;
}

.pg2a-menu-links li {
    margin-bottom: 1rem;
}

.pg2a-menu-links a {
    display: block;
    padding: 1rem;
    color: var(--pg2a-text);
    font-size: 1.4rem;
    border-radius: 0.4rem;
    transition: background 0.3s ease;
}

.pg2a-menu-links a:hover {
    background: var(--pg2a-bg-light);
    color: var(--pg2a-primary);
}

/* Main Content */
.pg2a-main {
    padding-top: 60px;
    padding-bottom: 80px;
}

/* Carousel */
.pg2a-carousel {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.pg2a-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.pg2a-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Section Titles */
.pg2a-section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--pg2a-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--pg2a-border);
}

/* Game Grid */
.pg2a-game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.pg2a-game-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.pg2a-game-item:hover {
    transform: scale(1.05);
}

.pg2a-game-icon {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.8rem;
    object-fit: cover;
    margin-bottom: 0.3rem;
    border: 2px solid var(--pg2a-border);
}

.pg2a-game-name {
    font-size: 1rem;
    color: var(--pg2a-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Category Section */
.pg2a-category-section {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.pg2a-category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.6rem;
    color: var(--pg2a-text-light);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--pg2a-primary);
}

/* Info Cards */
.pg2a-info-card {
    background: var(--pg2a-bg-light);
    border-radius: 0.8rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--pg2a-border);
}

.pg2a-info-card h3 {
    color: var(--pg2a-primary);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.pg2a-info-card p {
    color: var(--pg2a-text);
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.pg2a-info-card ul {
    list-style: none;
    padding-left: 0;
}

.pg2a-info-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--pg2a-text);
    font-size: 1.3rem;
}

.pg2a-info-card li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--pg2a-primary);
}

/* CTA Button */
.pg2a-cta-btn {
    display: block;
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--pg2a-primary) 0%, #c9a227 100%);
    color: var(--pg2a-bg);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    border-radius: 0.8rem;
    margin: 1.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pg2a-cta-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--pg2a-shadow);
}

/* Footer */
.pg2a-footer {
    background: var(--pg2a-bg-light);
    padding: 2rem 1rem;
    border-top: 1px solid var(--pg2a-border);
}

.pg2a-footer-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pg2a-footer-brand p {
    color: var(--pg2a-text);
    font-size: 1.2rem;
    line-height: 1.6;
}

.pg2a-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.pg2a-footer-links a {
    padding: 0.5rem 1rem;
    background: var(--pg2a-bg);
    border-radius: 0.4rem;
    font-size: 1.1rem;
    color: var(--pg2a-text-light);
    transition: all 0.3s ease;
}

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

.pg2a-footer-copyright {
    text-align: center;
    color: var(--pg2a-secondary);
    font-size: 1.1rem;
}

/* Bottom Navigation */
.pg2a-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(180deg, var(--pg2a-bg-light) 0%, var(--pg2a-bg) 100%);
    border-top: 1px solid var(--pg2a-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.pg2a-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
    background: none;
    border: none;
    color: var(--pg2a-text);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.8rem;
}

.pg2a-nav-btn:hover,
.pg2a-nav-btn.active {
    color: var(--pg2a-primary);
    background: rgba(212, 175, 55, 0.1);
}

.pg2a-nav-btn i,
.pg2a-nav-btn .material-icons {
    font-size: 24px;
    margin-bottom: 2px;
}

.pg2a-nav-btn span {
    font-size: 10px;
    font-weight: 500;
}

/* Responsive */
@media (min-width: 769px) {
    .pg2a-bottom-nav {
        display: none;
    }

    .pg2a-main {
        padding-bottom: 2rem;
    }

    .pg2a-container {
        max-width: 768px;
    }

    .pg2a-game-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .pg2a-main {
        padding-bottom: 80px;
    }
}

/* Utility Classes */
.pg2a-text-center { text-align: center; }
.pg2a-text-primary { color: var(--pg2a-primary); }
.pg2a-mb-1 { margin-bottom: 1rem; }
.pg2a-mb-2 { margin-bottom: 2rem; }
.pg2a-p-1 { padding: 1rem; }
.pg2a-p-2 { padding: 2rem; }
