/* RRRPH Layout CSS - Mobile First Design */
/* CSS classes use gb5a- prefix for namespace isolation */

/* CSS Variables */
:root {
    --gb5a-primary: #AFEEEE;
    --gb5a-secondary: #34495E;
    --gb5a-primary-dark: #8DC5C5;
    --gb5a-secondary-dark: #2C3E50;
    --gb5a-text-light: #FFFFFF;
    --gb5a-text-dark: #333333;
    --gb5a-accent: #FF6B6B;
    --gb5a-success: #4CAF50;
    --gb5a-warning: #FFC107;
    --gb5a-error: #F44336;
    --gb5a-background: #1A1A1A;
    --gb5a-surface: #2D2D2D;
    --gb5a-border: #404040;
    --gb5a-shadow: rgba(0, 0, 0, 0.3);
    --gb5a-gradient: linear-gradient(135deg, var(--gb5a-primary), var(--gb5a-primary-dark));
    --gb5a-header-height: 70px;
    --gb5a-footer-height: 60px;
    --gb5a-bottom-nav-height: 60px;
}

/* Reset and 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(--gb5a-primary);
    background-color: var(--gb5a-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(175, 238, 238, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(175, 238, 238, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Container */
.gb5a-container {
    max-width: 430px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.gb5a-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header */
.gb5a-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--gb5a-header-height);
    background: linear-gradient(135deg, var(--gb5a-secondary) 0%, var(--gb5a-secondary-dark) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gb5a-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    box-shadow: 0 2px 20px var(--gb5a-shadow);
}

.gb5a-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--gb5a-primary);
    font-weight: bold;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gb5a-logo img {
    width: 32px;
    height: 32px;
    margin-right: 0.8rem;
    border-radius: 8px;
    object-fit: cover;
}

.gb5a-nav-buttons {
    display: flex;
    gap: 1rem;
}

.gb5a-nav-btn {
    padding: 0.6rem 1.2rem;
    background: var(--gb5a-gradient);
    color: var(--gb5a-secondary-dark);
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    position: relative;
    overflow: hidden;
}

.gb5a-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.gb5a-nav-btn:hover::before {
    left: 100%;
}

.gb5a-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(175, 238, 238, 0.3);
}

.gb5a-nav-btn:active {
    transform: translateY(0);
}

.gb5a-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gb5a-primary);
    font-size: 2.4rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.gb5a-menu-toggle:hover {
    background: rgba(175, 238, 238, 0.1);
}

.gb5a-menu-toggle.gb5a-menu-active {
    background: var(--gb5a-primary);
    color: var(--gb5a-secondary-dark);
}

/* Mobile Menu */
.gb5a-mobile-menu {
    position: fixed;
    top: var(--gb5a-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 73, 94, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.gb5a-mobile-menu.gb5a-menu-open {
    transform: translateX(0);
}

.gb5a-mobile-menu-nav {
    padding: 2rem 1rem;
}

.gb5a-mobile-menu-item {
    display: block;
    padding: 1.2rem 1.5rem;
    margin: 0.5rem 0;
    background: rgba(175, 238, 238, 0.1);
    color: var(--gb5a-primary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.6rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.gb5a-mobile-menu-item:hover {
    background: var(--gb5a-gradient);
    color: var(--gb5a-secondary-dark);
    transform: translateX(5px);
    border-color: var(--gb5a-primary);
}

.gb5a-mobile-menu-item i {
    margin-right: 1rem;
    font-size: 1.8rem;
}

/* Main Content */
.gb5a-main {
    flex: 1;
    margin-top: var(--gb5a-header-height);
    padding-bottom: var(--gb5a-bottom-nav-height);
    position: relative;
    z-index: 1;
}

/* Carousel */
.gb5a-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 16px;
    margin: 1.5rem 0;
    box-shadow: 0 10px 30px var(--gb5a-shadow);
}

.gb5a-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.gb5a-carousel-slide.gb5a-slide-active {
    opacity: 1;
}

.gb5a-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gb5a-carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
    z-index: 10;
}

.gb5a-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gb5a-carousel-dot.gb5a-dot-active {
    background: var(--gb5a-primary);
    transform: scale(1.2);
}

.gb5a-carousel-prev,
.gb5a-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.6rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.gb5a-carousel-prev {
    left: 1rem;
}

.gb5a-carousel-next {
    right: 1rem;
}

.gb5a-carousel-prev:hover,
.gb5a-carousel-next:hover {
    background: var(--gb5a-accent);
}

/* Section Styles */
.gb5a-section {
    margin: 2rem 0;
    padding: 2rem 1rem;
    background: var(--gb5a-surface);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--gb5a-shadow);
    position: relative;
    overflow: hidden;
}

.gb5a-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gb5a-gradient);
}

.gb5a-section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--gb5a-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-left: 2rem;
}

.gb5a-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--gb5a-primary);
    border-radius: 2px;
}

/* Game Grid */
.gb5a-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.gb5a-game-item {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--gb5a-primary);
}

.gb5a-game-item:hover {
    transform: translateY(-5px) scale(1.05);
}

.gb5a-game-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px var(--gb5a-shadow);
    transition: all 0.3s ease;
}

.gb5a-game-item:hover .gb5a-game-icon {
    box-shadow: 0 8px 20px rgba(175, 238, 238, 0.3);
    border: 2px solid var(--gb5a-primary);
}

.gb5a-game-name {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category Filters */
.gb5a-category-filters {
    display: flex;
    gap: 0.8rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--gb5a-primary) var(--gb5a-surface);
}

.gb5a-category-filters::-webkit-scrollbar {
    height: 4px;
}

.gb5a-category-filters::-webkit-scrollbar-thumb {
    background: var(--gb5a-primary);
    border-radius: 2px;
}

.gb5a-category-filter {
    padding: 0.8rem 1.5rem;
    background: rgba(175, 238, 238, 0.1);
    color: var(--gb5a-primary);
    border: 1px solid var(--gb5a-border);
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
}

.gb5a-category-filter:hover {
    background: rgba(175, 238, 238, 0.2);
    border-color: var(--gb5a-primary);
}

.gb5a-category-filter.gb5a-filter-active {
    background: var(--gb5a-gradient);
    color: var(--gb5a-secondary-dark);
    border-color: var(--gb5a-primary);
    font-weight: 600;
}

/* Game Sections */
.gb5a-game-section {
    margin: 2rem 0;
}

.gb5a-game-section[data-category] {
    display: none;
}

.gb5a-game-section[data-category="all"] {
    display: block;
}

/* Button Styles */
.gb5a-btn {
    padding: 1rem 2rem;
    background: var(--gb5a-gradient);
    color: var(--gb5a-secondary-dark);
    border: none;
    border-radius: 25px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gb5a-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.gb5a-btn:active::after {
    width: 300px;
    height: 300px;
}

.gb5a-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(175, 238, 238, 0.4);
}

.gb5a-btn:active {
    transform: translateY(-1px);
}

.gb5a-btn-secondary {
    background: var(--gb5a-surface);
    color: var(--gb5a-primary);
    border: 2px solid var(--gb5a-primary);
}

.gb5a-btn-secondary:hover {
    background: var(--gb5a-primary);
    color: var(--gb5a-secondary-dark);
}

.gb5a-btn-outline {
    background: transparent;
    color: var(--gb5a-primary);
    border: 2px solid var(--gb5a-primary);
}

.gb5a-btn-outline:hover {
    background: var(--gb5a-primary);
    color: var(--gb5a-secondary-dark);
}

/* Card Styles */
.gb5a-card {
    background: var(--gb5a-surface);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 20px var(--gb5a-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--gb5a-border);
}

.gb5a-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--gb5a-shadow);
    border-color: var(--gb5a-primary);
}

.gb5a-card-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gb5a-primary);
}

.gb5a-card-content {
    font-size: 1.4rem;
    line-height: 1.6;
    color: rgba(175, 238, 238, 0.9);
}

/* Footer */
.gb5a-footer {
    background: linear-gradient(135deg, var(--gb5a-secondary) 0%, var(--gb5a-secondary-dark) 100%);
    padding: 2rem 0 1rem;
    margin-top: auto;
    border-top: 2px solid var(--gb5a-border);
}

.gb5a-footer-content {
    margin-bottom: 2rem;
}

.gb5a-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.gb5a-footer-link {
    color: var(--gb5a-primary);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.gb5a-footer-link:hover {
    background: rgba(175, 238, 238, 0.1);
    color: var(--gb5a-text-light);
}

.gb5a-partners {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.gb5a-partner img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.gb5a-partner:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.gb5a-copyright {
    text-align: center;
    color: var(--gb5a-primary);
    font-size: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gb5a-border);
    opacity: 0.8;
}

/* Bottom Navigation */
.gb5a-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--gb5a-bottom-nav-height);
    background: linear-gradient(135deg, var(--gb5a-secondary) 0%, var(--gb5a-secondary-dark) 100%);
    border-top: 2px solid var(--gb5a-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 20px var(--gb5a-shadow);
}

.gb5a-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gb5a-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.gb5a-bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gb5a-primary);
    transition: width 0.3s ease;
}

.gb5a-bottom-nav-item:hover::before,
.gb5a-bottom-nav-item.gb5a-nav-active::before {
    width: 100%;
}

.gb5a-bottom-nav-item:hover,
.gb5a-bottom-nav-item.gb5a-nav-active {
    background: rgba(175, 238, 238, 0.1);
    color: var(--gb5a-text-light);
}

.gb5a-bottom-nav-icon {
    font-size: 2.4rem;
    margin-bottom: 0.2rem;
    transition: all 0.3s ease;
}

.gb5a-bottom-nav-item:hover .gb5a-bottom-nav-icon,
.gb5a-bottom-nav-item.gb5a-nav-active .gb5a-bottom-nav-icon {
    transform: scale(1.1);
}

.gb5a-bottom-nav-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Responsive Design */
@media (min-width: 769px) {
    .gb5a-bottom-nav {
        display: none;
    }

    .gb5a-main {
        padding-bottom: 0;
    }

    .gb5a-menu-toggle {
        display: block;
    }

    .gb5a-container {
        padding: 0 2rem;
    }

    .gb5a-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 1.5rem;
    }

    .gb5a-game-icon {
        width: 100px;
        height: 100px;
    }

    .gb5a-carousel {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .gb5a-menu-toggle {
        display: block;
    }

    .gb5a-nav-buttons {
        display: none;
    }

    .gb5a-mobile-menu {
        transform: translateX(100%);
    }
}

@media (max-width: 480px) {
    .gb5a-container {
        padding: 0 0.5rem;
    }

    .gb5a-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.8rem;
    }

    .gb5a-game-icon {
        width: 70px;
        height: 70px;
    }

    .gb5a-section {
        margin: 1.5rem 0;
        padding: 1.5rem 0.8rem;
    }

    .gb5a-section-title {
        font-size: 1.8rem;
    }

    .gb5a-carousel {
        height: 180px;
        margin: 1rem 0;
    }
}

/* Loading States */
.gb5a-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.gb5a-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gb5a-primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: gb5a-spin 1s linear infinite;
}

@keyframes gb5a-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.gb5a-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-size: 1.4rem;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.gb5a-toast.gb5a-toast-show {
    transform: translateX(0);
}

.gb5a-toast.gb5a-toast-info {
    background: var(--gb5a-primary);
    color: var(--gb5a-secondary-dark);
}

.gb5a-toast.gb5a-toast-success {
    background: var(--gb5a-success);
}

.gb5a-toast.gb5a-toast-warning {
    background: var(--gb5a-warning);
    color: var(--gb5a-secondary-dark);
}

.gb5a-toast.gb5a-toast-error {
    background: var(--gb5a-error);
}

/* Accessibility */
.gb5a-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.gb5a-btn:focus,
.gb5a-nav-btn:focus,
.gb5a-category-filter:focus,
.gb5a-bottom-nav-item:focus {
    outline: 2px solid var(--gb5a-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .gb5a-header,
    .gb5a-bottom-nav,
    .gb5a-mobile-menu {
        display: none !important;
    }

    .gb5a-main {
        margin-top: 0;
        padding-bottom: 0;
    }

    body {
        background: white;
        color: black;
    }

    .gb5a-section {
        background: white;
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}