/**
 * PHP777 Login - Theme CSS
 * All classes use 'pg57-' prefix for namespace isolation
 */

/* CSS Variables */
:root {
    /* Color scheme: #DEB887 | #1C2833 */
    --pg57-primary: #DEB887;
    --pg57-secondary: #1C2833;
    --pg57-bg: #0f1419;
    --pg57-bg-light: #1a2332;
    --pg57-text: #e8e6e3;
    --pg57-text-secondary: #a8b4cf;
    --pg57-accent: #ffd700;
    --pg57-success: #28a745;
    --pg57-warning: #ffc107;
    --pg57-danger: #dc3545;
    --pg57-border: #2a3441;
    --pg57-shadow: rgba(0, 0, 0, 0.3);

    /* Typography */
    --pg57-font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --pg57-font-size-xs: 1rem;
    --pg57-font-size-sm: 1.2rem;
    --pg57-font-size-base: 1.4rem;
    --pg57-font-size-lg: 1.6rem;
    --pg57-font-size-xl: 1.8rem;
    --pg57-font-size-2xl: 2.2rem;
    --pg57-font-size-3xl: 2.8rem;

    /* Spacing */
    --pg57-space-xs: 0.5rem;
    --pg57-space-sm: 1rem;
    --pg57-space-md: 1.5rem;
    --pg57-space-lg: 2rem;
    --pg57-space-xl: 3rem;

    /* Layout */
    --pg57-container-max: 430px;
    --pg57-header-height: 60px;
    --pg57-bottom-nav-height: 64px;

    /* Transitions */
    --pg57-transition: all 0.3s ease;
    --pg57-transition-fast: all 0.15s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--pg57-font-primary);
    font-size: var(--pg57-font-size-base);
    line-height: 1.5;
    color: var(--pg57-text);
    background-color: var(--pg57-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Utility Classes */
.pg57-container {
    max-width: var(--pg57-container-max);
    margin: 0 auto;
    padding: 0 var(--pg57-space-sm);
}

.pg57-wrapper {
    position: relative;
    width: 100%;
}

.pg57-grid {
    display: grid;
    gap: var(--pg57-space-sm);
}

.pg57-flex {
    display: flex;
}

.pg57-flex-col {
    flex-direction: column;
}

.pg57-items-center {
    align-items: center;
}

.pg57-justify-center {
    justify-content: center;
}

.pg57-justify-between {
    justify-content: space-between;
}

.pg57-text-center {
    text-align: center;
}

.pg57-text-primary {
    color: var(--pg57-primary);
}

.pg57-text-secondary {
    color: var(--pg57-text-secondary);
}

.pg57-bg-primary {
    background-color: var(--pg57-primary);
}

.pg57-bg-secondary {
    background-color: var(--pg57-secondary);
}

/* Header */
.pg57-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--pg57-header-height);
    background-color: var(--pg57-bg);
    border-bottom: 1px solid var(--pg57-border);
    z-index: 1000;
    transition: var(--pg57-transition);
}

.pg57-header.scrolled {
    background-color: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(10px);
}

.pg57-header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pg57-space-sm);
}

.pg57-logo {
    display: flex;
    align-items: center;
    gap: var(--pg57-space-xs);
    text-decoration: none;
    color: var(--pg57-primary);
    font-weight: bold;
    font-size: var(--pg57-font-size-lg);
}

.pg57-logo img {
    width: 28px;
    height: 28px;
}

.pg57-header-actions {
    display: flex;
    align-items: center;
    gap: var(--pg57-space-sm);
}

.pg57-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--pg57-space-xs) var(--pg57-space-md);
    border: none;
    border-radius: 6px;
    font-size: var(--pg57-font-size-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--pg57-transition-fast);
    min-height: 44px;
    white-space: nowrap;
}

.pg57-btn-primary {
    background-color: var(--pg57-primary);
    color: var(--pg57-secondary);
}

.pg57-btn-primary:hover {
    background-color: #e6c78a;
    transform: translateY(-1px);
}

.pg57-btn-outline {
    background-color: transparent;
    color: var(--pg57-primary);
    border: 2px solid var(--pg57-primary);
}

.pg57-btn-outline:hover {
    background-color: var(--pg57-primary);
    color: var(--pg57-secondary);
}

.pg57-menu-toggle {
    background: none;
    border: none;
    color: var(--pg57-primary);
    font-size: 2.4rem;
    cursor: pointer;
    padding: var(--pg57-space-xs);
    display: none;
}

/* Navigation */
.pg57-nav {
    display: flex;
    gap: var(--pg57-space-md);
}

.pg57-nav-item {
    color: var(--pg57-text);
    text-decoration: none;
    font-size: var(--pg57-font-size-sm);
    transition: var(--pg57-transition-fast);
    position: relative;
}

.pg57-nav-item:hover {
    color: var(--pg57-primary);
}

.pg57-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--pg57-primary);
}

/* Mobile Menu */
.pg57-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--pg57-bg);
    z-index: 9999;
    transition: var(--pg57-transition);
    overflow-y: auto;
    border-left: 1px solid var(--pg57-border);
}

.pg57-mobile-menu.active {
    right: 0;
}

.pg57-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--pg57-transition);
}

.pg57-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pg57-mobile-menu-header {
    padding: var(--pg57-space-md);
    border-bottom: 1px solid var(--pg57-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pg57-mobile-menu-close {
    background: none;
    border: none;
    color: var(--pg57-text);
    font-size: 2.4rem;
    cursor: pointer;
}

.pg57-mobile-menu-list {
    list-style: none;
    padding: var(--pg57-space-sm);
}

.pg57-mobile-menu-item {
    border-bottom: 1px solid var(--pg57-border);
}

.pg57-mobile-menu-link {
    display: block;
    padding: var(--pg57-space-md);
    color: var(--pg57-text);
    text-decoration: none;
    transition: var(--pg57-transition-fast);
}

.pg57-mobile-menu-link:hover {
    background-color: var(--pg57-bg-light);
    color: var(--pg57-primary);
}

/* Main Content */
.pg57-main {
    padding-top: var(--pg57-header-height);
    min-height: 100vh;
}

/* Mobile-first responsive padding for bottom nav */
@media (max-width: 768px) {
    .pg57-main {
        padding-bottom: var(--pg57-bottom-nav-height);
    }
}

/* Carousel */
.pg57-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: var(--pg57-space-lg);
}

.pg57-carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
}

.pg57-slide {
    min-width: 100%;
    position: relative;
    cursor: pointer;
}

.pg57-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.pg57-carousel-indicators {
    position: absolute;
    bottom: var(--pg57-space-sm);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--pg57-space-xs);
}

.pg57-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--pg57-transition-fast);
}

.pg57-dot.active {
    background-color: var(--pg57-primary);
    width: 24px;
    border-radius: 4px;
}

/* Game Cards */
.pg57-games-section {
    margin-bottom: var(--pg57-space-xl);
}

.pg57-section-title {
    font-size: var(--pg57-font-size-2xl);
    color: var(--pg57-primary);
    margin-bottom: var(--pg57-space-md);
    text-align: center;
}

.pg57-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--pg57-space-sm);
}

.pg57-game-card {
    background-color: var(--pg57-bg-light);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--pg57-transition);
    cursor: pointer;
    text-decoration: none;
}

.pg57-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--pg57-shadow);
}

.pg57-game-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.pg57-game-name {
    padding: var(--pg57-space-xs);
    font-size: var(--pg57-font-size-xs);
    color: var(--pg57-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Content Sections */
.pg57-content-section {
    background-color: var(--pg57-bg-light);
    border-radius: 12px;
    padding: var(--pg57-space-lg);
    margin-bottom: var(--pg57-space-lg);
}

.pg57-content-section h2 {
    font-size: var(--pg57-font-size-xl);
    color: var(--pg57-primary);
    margin-bottom: var(--pg57-space-md);
}

.pg57-content-section p {
    color: var(--pg57-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--pg57-space-sm);
}

.pg57-content-section a {
    color: var(--pg57-primary);
    text-decoration: none;
    font-weight: 600;
}

.pg57-content-section a:hover {
    text-decoration: underline;
}

/* Bottom Navigation */
.pg57-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--pg57-bottom-nav-height);
    background-color: var(--pg57-bg);
    border-top: 1px solid var(--pg57-border);
    z-index: 1000;
    display: none;
}

.pg57-bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0 var(--pg57-space-xs);
}

.pg57-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
    padding: var(--pg57-space-xs);
    text-decoration: none;
    color: var(--pg57-text-secondary);
    transition: var(--pg57-transition-fast);
    border-radius: 8px;
}

.pg57-bottom-nav-item:hover {
    color: var(--pg57-primary);
    background-color: var(--57-bg-light);
}

.pg57-bottom-nav-item.active {
    color: var(--pg57-primary);
}

.pg57-bottom-nav-icon {
    font-size: 2.4rem;
    margin-bottom: 2px;
}

.pg57-bottom-nav-text {
    font-size: 1rem;
    text-align: center;
}

/* Footer */
.pg57-footer {
    background-color: var(--pg57-bg-light);
    border-top: 1px solid var(--pg57-border);
    padding: var(--pg57-space-xl) 0;
    margin-top: var(--pg57-space-xl);
}

.pg57-partners {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--pg57-space-md);
    margin-bottom: var(--pg57-space-lg);
}

.pg57-partner-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    opacity: 0.7;
    transition: var(--pg57-transition);
}

.pg57-partner-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.pg57-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--pg57-space-md);
    margin-bottom: var(--pg57-space-lg);
}

.pg57-footer-link {
    color: var(--pg57-text-secondary);
    text-decoration: none;
    font-size: var(--pg57-font-size-sm);
    transition: var(--pg57-transition-fast);
}

.pg57-footer-link:hover {
    color: var(--pg57-primary);
}

.pg57-copyright {
    text-align: center;
    color: var(--pg57-text-secondary);
    font-size: var(--pg57-font-size-xs);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pg57-menu-toggle {
        display: block;
    }

    .pg57-nav {
        display: none;
    }

    .pg57-bottom-nav {
        display: block;
    }

    .pg57-header-actions .pg57-btn:not(.pg57-menu-toggle) {
        display: none;
    }

    .pg57-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .pg57-game-image {
        height: 70px;
    }

    .pg57-content-section {
        padding: var(--pg57-space-md);
    }

    .pg57-footer-links {
        gap: var(--pg57-space-sm);
    }
}

@media (max-width: 480px) {
    .pg57-container {
        padding: 0 var(--pg57-space-xs);
    }

    .pg57-games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--pg57-space-xs);
    }

    .pg57-game-image {
        height: 60px;
    }

    .pg57-section-title {
        font-size: var(--pg57-font-size-xl);
    }

    .pg57-content-section h2 {
        font-size: var(--pg57-font-size-lg);
    }
}

/* Animations */
@keyframes pg57fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pg57-fade-in {
    animation: pg57fadeIn 0.5s ease-out;
}

/* Utility for hiding elements */
.pg57-hidden {
    display: none !important;
}

/* Loading state */
.pg57-loading {
    position: relative;
    overflow: hidden;
}

.pg57-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}