/* ============================================
   AKL GAMING HUB
   MAIN STYLE (Dark & Light Mode Support Fixed)
============================================ */

:root {
    --bg-color: #0a0a0a;
    --header-bg: #0f0f0f;
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    --card-bg: #141414;
    --card-border: #222222;
    --card-border-hover: #fbbf24;
    --search-bg: #1a1a1a;
    --search-border: #2a2a2a;
    --accent-color: #fbbf24;
}

body.light-theme {
    --bg-color: #f3f4f6;
    --header-bg: #ffffff;
    --text-color: #1f2937;
    --text-muted: #4b5563;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --card-border-hover: #d97706;
    --search-bg: #e5e7eb;
    --search-border: #d1d5db;
    --accent-color: #d97706;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

#splashScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
}

.splash-icon {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s ease-in-out infinite;
}

.splash-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.splash-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.splash-loader {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid var(--card-border);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#mainApp {
    display: none;
    padding-bottom: 80px;
}

.app-header {
    background: var(--header-bg);
    padding: 12px 20px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--text-color) 30%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tg-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #0088cc;
    color: #fff;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    margin-right: 8px;
}

.search-container {
    padding: 15px 20px;
    background: var(--header-bg);
    transition: background 0.3s ease;
}

.search-box {
    background: var(--search-bg);
    border-radius: 25px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--search-border);
}

.search-box:focus-within {
    border-color: var(--accent-color);
}

.search-icon {
    font-size: 18px;
    color: var(--text-muted);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 16px;
}

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

/* Type Switcher Tabs (Games / Apps) */
.type-tabs {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 15px;
}
.type-tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--card-border);
    transition: all 0.2s ease;
}
.type-tab-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.main-content {
    padding: 0 20px 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 25px 0 15px;
    color: var(--text-color);
}

.featured-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 5px 0 18px;
    scrollbar-width: none;
}

.featured-scroll::-webkit-scrollbar {
    display: none;
}

.featured-card {
    min-width: 140px;
    max-width: 140px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 10px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform .15s ease, border-color .15s ease;
}

.featured-card:active {
    transform: scale(.97);
}

.featured-card .game-card-image {
    width: 75px !important;
    height: 75px !important;
    min-width: 75px !important;
    min-height: 75px !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
    object-fit: cover !important;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.featured-card .game-card-name {
    font-size: 13px !important;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    color: var(--text-color) !important; /* Dark mode စာသားအဖြူပေါ်စေရန် */
}

/* Categories Section */
.categories-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0 15px;
    scrollbar-width: none;
    pointer-events: auto !important;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 10px 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 25px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    pointer-events: auto !important;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.category-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    font-weight: 600;
}

/* Latest Games List Layout */
.games-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.game-card:hover {
    border-color: var(--card-border-hover);
}

.game-card:active {
    transform: scale(.97);
}

.game-card .game-card-image, 
.game-card img {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    display: block;
    margin: 0 !important;
    background: var(--search-bg);
}

.game-info-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    flex: 1;
}

.game-card-name {
    width: 100%;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 18px !important;
    text-align: left !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-color) !important; /* Dark mode စာသားအဖြူပေါ်စေရန် */
}

.game-card-version {
    font-size: 12px;
    color: var(--text-muted) !important; /* Version စာသားများ မှေးမှေးလေးပေါ်စေရန် */
    margin-top: 4px;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: none;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--card-border);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.page-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.no-games {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 16px;
}

.firebase-error {
    width: 100%;
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--header-bg);
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    transition: background 0.3s ease;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 20px;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    font-family: inherit;
}

.nav-item.active {
    color: var(--accent-color);
}
