/**
 * jili58 - Theme Stylesheet
 * All classes use pg7d- prefix for namespace isolation
 * Color Scheme: #212F3D (background), #9370DB (accent)
 * Mobile-first responsive design
 */

/* CSS Variables */
:root {
    --pg7d-bg-primary: #212F3D;
    --pg7d-bg-secondary: #1a2633;
    --pg7d-bg-tertiary: #141d26;
    --pg7d-accent: #9370DB;
    --pg7d-accent-light: #a88fe8;
    --pg7d-accent-dark: #7b5bc7;
    --pg7d-text-primary: #ffffff;
    --pg7d-text-secondary: #b8b8b8;
    --pg7d-text-muted: #888888;
    --pg7d-border: #3a4a5c;
    --pg7d-success: #22c55e;
    --pg7d-warning: #f59e0b;
    --pg7d-danger: #ef4444;
    --pg7d-shadow: rgba(0, 0, 0, 0.3);
    --pg7d-radius: 8px;
    --pg7d-radius-sm: 4px;
    --pg7d-radius-lg: 12px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 1.5;
    color: var(--pg7d-text-primary);
    background-color: var(--pg7d-bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body.pg7d-loaded {
    animation: pg7d-fadeIn 0.3s ease-in;
}

@keyframes pg7d-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Container & Layout */
.pg7d-container {
    max-width: 430px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.pg7d-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.pg7d-main {
    flex: 1;
    padding-bottom: 80px;
}

@media (min-width: 769px) {
    .pg7d-main {
        padding-bottom: 2rem;
    }
}

/* Header */
.pg7d-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--pg7d-bg-secondary);
    border-bottom: 1px solid var(--pg7d-border);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.pg7d-header.pg7d-header-hidden {
    transform: translateY(-100%);
}

.pg7d-header-inner {
    max-width: 430px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    gap: 1rem;
}

.pg7d-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--pg7d-text-primary);
    font-weight: 700;
    font-size: 1.8rem;
}

.pg7d-logo img {
    width: 32px;
    height: 32px;
    border-radius: var(--pg7d-radius-sm);
}

.pg7d-header-buttons {
    display: flex;
    gap: 0.5rem;
}

.pg7d-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--pg7d-radius);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.pg7d-btn-primary {
    background-color: var(--pg7d-accent);
    color: white;
}

.pg7d-btn-primary:hover {
    background-color: var(--pg7d-accent-dark);
    transform: translateY(-1px);
}

.pg7d-btn-secondary {
    background-color: transparent;
    color: var(--pg7d-accent);
    border: 1px solid var(--pg7d-accent);
}

.pg7d-btn-secondary:hover {
    background-color: var(--pg7d-accent);
    color: white;
}

.pg7d-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.pg7d-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--pg7d-text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.pg7d-menu-toggle.pg7d-menu-open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.pg7d-menu-toggle.pg7d-menu-open span:nth-child(2) {
    opacity: 0;
}

.pg7d-menu-toggle.pg7d-menu-open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.pg7d-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--pg7d-bg-secondary);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1rem;
    box-shadow: -2px 0 10px var(--pg7d-shadow);
}

.pg7d-mobile-menu.pg7d-menu-open {
    right: 0;
}

.pg7d-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.pg7d-mobile-menu-close {
    background: none;
    border: none;
    color: var(--pg7d-text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.pg7d-mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pg7d-mobile-menu-nav a {
    padding: 1rem;
    color: var(--pg7d-text-primary);
    text-decoration: none;
    border-radius: var(--pg7d-radius);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pg7d-mobile-menu-nav a:hover {
    background-color: var(--pg7d-bg-tertiary);
}

.pg7d-mobile-menu-nav i {
    width: 24px;
    text-align: center;
}

/* Mobile Menu Overlay */
.pg7d-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pg7d-menu-overlay.pg7d-menu-open {
    opacity: 1;
    visibility: visible;
}

/* Carousel */
.pg7d-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--pg7d-radius-lg);
    margin: 1rem 0;
}

.pg7d-carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.pg7d-carousel-slide {
    min-width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.pg7d-carousel-slide.pg7d-slide-active {
    opacity: 1;
    position: relative;
}

.pg7d-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.pg7d-carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.pg7d-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pg7d-carousel-dot.pg7d-dot-active {
    background-color: var(--pg7d-accent);
    width: 24px;
    border-radius: 4px;
}

/* Content Sections */
.pg7d-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--pg7d-border);
}

.pg7d-section:last-child {
    border-bottom: none;
}

.pg7d-section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--pg7d-accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pg7d-section-title i {
    font-size: 1.6rem;
}

/* Game Grid */
.pg7d-game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.pg7d-game-card {
    background-color: var(--pg7d-bg-secondary);
    border-radius: var(--pg7d-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--pg7d-text-primary);
    display: block;
}

.pg7d-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--pg7d-shadow);
}

.pg7d-game-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.pg7d-game-card-title {
    padding: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Content Cards */
.pg7d-card {
    background-color: var(--pg7d-bg-secondary);
    border-radius: var(--pg7d-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--pg7d-border);
}

.pg7d-card-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--pg7d-accent);
    margin-bottom: 1rem;
}

.pg7d-card-content {
    color: var(--pg7d-text-secondary);
    line-height: 1.6;
}

.pg7d-card-content p {
    margin-bottom: 1rem;
}

.pg7d-card-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.pg7d-link {
    color: var(--pg7d-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.pg7d-link:hover {
    color: var(--pg7d-accent-light);
    text-decoration: underline;
}

/* Lists */
.pg7d-list {
    list-style: none;
    padding: 0;
}

.pg7d-list-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--pg7d-border);
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.pg7d-list-item:last-child {
    border-bottom: none;
}

.pg7d-list-item i {
    color: var(--pg7d-accent);
    margin-top: 0.3rem;
    flex-shrink: 0;
}

/* Bottom Navigation */
.pg7d-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--pg7d-bg-secondary) 0%, var(--pg7d-bg-tertiary) 100%);
    border-top: 2px solid var(--pg7d-accent);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px var(--pg7d-shadow);
}

@media (min-width: 769px) {
    .pg7d-bottom-nav {
        display: none;
    }
}

.pg7d-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
    color: var(--pg7d-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.3rem;
    border-radius: var(--pg7d-radius);
}

.pg7d-bottom-nav-item:hover {
    background-color: rgba(147, 112, 219, 0.1);
    color: var(--pg7d-accent);
}

.pg7d-bottom-nav-item.pg7d-nav-active {
    color: var(--pg7d-accent);
}

.pg7d-bottom-nav-item.pg7d-nav-active .pg7d-nav-icon {
    transform: scale(1.1);
}

.pg7d-nav-icon {
    font-size: 24px;
    margin-bottom: 0.2rem;
    transition: transform 0.2s ease;
}

.pg7d-nav-text {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
}

/* Footer */
.pg7d-footer {
    background-color: var(--pg7d-bg-secondary);
    padding: 2rem 0 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--pg7d-border);
}

.pg7d-footer-content {
    max-width: 430px;
    margin: 0 auto;
    padding: 0 1rem;
}

.pg7d-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.pg7d-footer-links a {
    color: var(--pg7d-text-secondary);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.pg7d-footer-links a:hover {
    color: var(--pg7d-accent);
}

.pg7d-footer-partners {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.pg7d-footer-partners img {
    height: 30px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.pg7d-footer-partners img:hover {
    opacity: 1;
}

.pg7d-footer-copyright {
    text-align: center;
    color: var(--pg7d-text-muted);
    font-size: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pg7d-border);
}

/* Utility Classes */
.pg7d-text-center {
    text-align: center;
}

.pg7d-mt-1 { margin-top: 1rem; }
.pg7d-mt-2 { margin-top: 2rem; }
.pg7d-mb-1 { margin-bottom: 1rem; }
.pg7d-mb-2 { margin-bottom: 2rem; }

.pg7d-hidden {
    display: none;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .pg7d-desktop-only {
        display: none;
    }
}

@media (min-width: 769px) {
    .pg7d-mobile-only {
        display: none;
    }

    .pg7d-container {
        max-width: 1200px;
    }

    .pg7d-game-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Animation */
@keyframes pg7d-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pg7d-pulse {
    animation: pg7d-pulse 2s infinite;
}

/* Print Styles */
@media print {
    .pg7d-header,
    .pg7d-bottom-nav,
    .pg7d-mobile-menu {
        display: none;
    }

    .pg7d-main {
        padding-bottom: 0;
    }
}
