/* =========== 0. INTL =========== */
:root {
    --app-max-width: 480px;
    --app-header-height: 60px;
    --app-bottom-nav-height: 60px;
}
/* ===== FOR TABLET ====== */
@media (min-width: 768px) {
    :root {
        --app-max-width: 768px; /* ปรับให้พอดีกับขนาด Tablet */
    }
}
* {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
}
/* Utility SVG Sizing */
.svg-12 { width: 12px; height: 12px; }
.svg-16 { width: 16px; height: 16px; }
.svg-18 { width: 18px; height: 18px; }
.svg-24 { width: 24px; height: 24px; }
h3>svg { width: 18px; height: 18px; }

/* Theme visibility utilities - Bootstrap 5.3 native */
[data-bs-theme="dark"] .show-on-light {
    display: none !important;
}
[data-bs-theme="light"] .show-on-dark {
    display: none !important;
}

/* =================================
1. Core Layout & App Frame
================================= */
body {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    background: #111;
    overflow-x: hidden;
}

.main-container {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: 100dvh;

    margin: 0 auto;

    padding-top: var(--app-header-height);
    padding-bottom: var(--app-bottom-nav-height);

    background: var(--bs-body-bg);

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);

    transition: background-color 0.3s, color 0.3s;
}

/* 1.1 Header (Fixed) */
.app-header {
    /*background: linear-gradient(to right, #FFFFFF, #f0f0f0);*/
    background: #FFFFFF;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    z-index: 1030; /* BS5 z-index */
    height: var(--app-header-height);
    max-width: var(--app-max-width);
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    /*box-shadow: 0 2px 5px rgba(0,0,0,0.1);*/
}
.app-header .logo img { max-height: 40px; }
.app-header .app-header-right a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

/* 1.2 Footer Nav (Fixed) */
.app-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--app-bottom-nav-height);
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
    background-color: #ffffff;
    position: fixed;
    bottom: 0;
    z-index: 1030;
    max-width: var(--app-max-width);
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    transition: background-color 0.3s, border-top 0.3s;
}
.app-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #555;
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 300;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.app-bottom-nav .nav-item i { font-size: 1.4rem; margin-bottom: 4px; }

/* =================================
2. Main Content
================================= */
main { margin-top: 10px; }
.app-content { padding: 15px; position: relative; }
.app-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 15px; text-align: center; }

/* =================================
2.1 Content Section (Full Height)
================================= */
#content-section {
    background-color: #ffffff;
    color: #333;
    min-height: calc(100vh - var(--app-header-height) - var(--app-bottom-nav-height));
    padding: 15px;
    transition: background-color 0.3s, color 0.3s;
    box-sizing: border-box;
}

[data-bs-theme="dark"] #content-section {
    background-color: var(--bs-body-bg, #1e1e1e);
    color: var(--bs-body-color, #f8f9fa);
}

/* =================================
3. Off-Canvas Menu (BS5 Override)
================================= */
/* ปรับแต่ง Offcanvas ของ BS5 ให้เข้ากับธีม */
.offcanvas-end {
    width: 85%;
    max-width: 360px;
    border-left: none;
}
.offcanvas-body {
    padding: 0;
    background-color: #f4f4f4;
    padding-top: 10px;
}
.offcanvas-footer {
    background-color: #f4f4f4;
    padding: 10px;
    text-align: center;
}
.profile-header { background: linear-gradient(to right, #e85a73, #df4a62); color: white; padding: 1.5rem 1rem; }
.balance-card { background: linear-gradient(to right, #5d6973, #3b434a); color: white; margin: 1rem; border-radius: 12px; padding: 10px; }
.balance-card .display-4 { font-weight: 600; color: #ffc300; font-size: 2.5rem; }
.menu-grid { padding: 0 1rem; }
.menu-button {
    background-color: #fff; border-radius: 8px; padding: 0.75rem;
    font-size: 0.9rem; font-weight: 400; color: #333; text-decoration: none;
    display: flex; align-items: center; margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: all 0.2s;
}
.menu-button:active { transform: scale(0.98); }
.theme-switch-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; margin: 0 1rem 1rem 1rem;
    background-color: #fff; border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); color: #333;
}
/* Toggle Switch CSS */
.theme-switch { position: relative; display: inline-block; width: 50px; height: 26px; margin-bottom: 0; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #ffc300; }
input:checked + .slider:before { transform: translateX(24px); }

/* =================================
4. DARK THEME (Bootstrap Native)
================================= */
/* Bootstrap 5.3 handles dark theme via data-bs-theme="dark" */
[data-bs-theme="dark"] .app-bottom-nav { background-color: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); }
[data-bs-theme="dark"] .app-bottom-nav .nav-item { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .offcanvas-body { background-color: var(--bs-body-bg); }
[data-bs-theme="dark"] .offcanvas-footer { background-color: var(--bs-body-bg); }
[data-bs-theme="dark"] .menu-button { background-color: var(--bs-tertiary-bg); color: var(--bs-body-color); }
[data-bs-theme="dark"] .theme-switch-wrapper { background-color: var(--bs-tertiary-bg); color: var(--bs-body-color); }
[data-bs-theme="dark"] .app-header { background: var(--bs-body-bg); color: var(--bs-body-color); border-bottom: 1px solid var(--bs-border-color); }
[data-bs-theme="dark"] .app-header .app-header-right a { color: var(--bs-body-color); }
[data-bs-theme="dark"] .jackpot-links a { color: var(--bs-secondary-color); }

/* =================================
5. Floating Sticky Menu
================================= */
.floating-menu {
    position: fixed; top: 60%; right: 0; z-index: 1040;
    background-color: #a51c30; border-radius: 10px 0 0 10px;
    padding: 5px; box-shadow: -2px 2px 5px rgba(0,0,0,0.2);
    transition: right 0.3s ease-in-out; width: 60px;
}
.floating-menu-toggle {
    position: absolute; left: -20px; top: 50%; transform: translateY(-50%);
    background-color: #e74c3c; color: white; padding: 15px 4px;
    border-radius: 8px 0 0 8px; cursor: pointer; font-size: 0.7rem; width: 20px;
    display: flex; align-items: center; justify-content: center;
}
.floating-menu-item { display: block; text-align: center; margin-bottom: 10px; }
.floating-menu-item:last-child { margin-bottom: 0; }
.floating-menu-item i { font-size: 1.8rem; color: white; opacity: 0.9; }
.floating-menu-item i.fa-line { color: #00c300; background-color: white; border-radius: 50%; padding: 4px; font-size: 1.6rem; }
.floating-menu.collapsed { right: -55px; }

/* ================ SWL ===================== */
[data-bs-theme="dark"] .swal2-popup {
    background-color: #1e1e1e !important;
    color: white !important;
}
[data-bs-theme="dark"] .swal2-title,
[data-bs-theme="dark"] .swal2-html-container {
    color: white !important;
}

/* ============== GOOGLE LOGIN =============== */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FFFFFF;
    color: #757575;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 2px 12px 2px 2px;
    text-decoration: none;
    transition: box-shadow 0.3s ease;
    width: 100%;
    margin-bottom: 1rem;
}
.btn-google:hover {
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15);
    background-color: #f8f9fa;
}

.google-icon-wrapper {
    padding: 10px;
    border-radius: 2px;
    display: flex;
    align-items: center;
}

.google-icon-wrapper svg {
    width: 18px;
    height: 18px;
}

.btn-text {
    margin-left: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* ปรับแต่งสำหรับ Dark Theme */
[data-bs-theme="dark"] .btn-google {
    background-color: #131314;
    border: 1px solid #8e918f;
    color: #e3e3e3;
}

[data-bs-theme="dark"] .btn-google:hover {
    background-color: #202124;
    box-shadow: none;
}

/* ============= landing ============ */
.games-title {
    font-size: 20px;
    padding: 0px;
}
.games-title svg {
    height: 22px;
}
.game-icon {
    border-radius: 10px;
}
.game-hits-icon {
    width: 100%;
}

/* =========== games ================= */
.game-wrapper {
    display: flex;
}
.game-wrapper-left {
    width: 100px;
    top: 70px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 5px;
    z-index: 10;
    /*background: #FFFFFF;*/
}
.game-wrapper-left .game-provider-logo-left {
    width: 100%;
}
[data-bs-theme="dark"] .game-wrapper-left {
    background-color: #222222;
    color: #FFFFFF;
}
.game-wrapper-left-menu {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 5px 2px;
    text-align: center;
    color: #444444;
    font-size: 0.7em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-decoration: none;
}
.game-wrapper-left-menu i {
    margin: 0 auto;
    display: block;
    font-size: 2rem;
    color: #888888;
}
.game-wrapper-left-menu.active {
    background-color: #0a4ab3;
    color: #FFFFFF;
    font-weight: bolder;
}
.game-wrapper-left-menu.active i {
    color: gold;
    position: relative;
    top:-5px;
}

.game-wrapper-left-provider {
    border-radius: 10px;
}
.game-wrapper-left-provider img {
    width: 100%;
}
.game-wrapper-left-provider:not(:first-child) img {
    filter: grayscale(80%);
}
.game-wrapper-left-provider:hover img {
    filter: grayscale(0%);
}



.game-wrapper-right {
    flex: 1;
    padding: 10px;
}
.game-right-logo a {
    color: #222222;
    text-decoration: none;
}
[data-bs-theme="dark"] .game-right-logo a {
    color: #FFFFFF;
}
.game-right-logo img {
    width: 100%;
    border-radius: 10px;
}
.game-right-logo .game-title {
    font-size: 0.75em;
    text-align: center;
}

/* =================== coin =================== */
.wallet-coin-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.wallet-coin-list .coin-list-block {

}
.wallet-coin-list .coin-list-block a {
    padding: 10px 5px;
    background-color: #FFFFFF;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid #222222;
    display: block;
    width: 100%;
}

/* ================= header menu ================= */

.header-menu {
    /*background-color: #030C30;*/
    color: #eeeeee;
    text-align: center;
}
.header-menu ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 40px;
}
.header-menu ul li {
    list-style: none;
}
.header-menu-link .header-menu-icon {
    width: 60px;

    margin: 0 auto;
}
.header-menu-link{
    margin: 0 auto;
    color: #eeeeee;
    font-size: 0.9em;
    font-weight: bolder;
    text-decoration: none;
}
@media (max-width: 991px) {
    .header-menu ul {
        gap: 20px;
    }
}

.provider-gamelist {

}
.provider-gamelist img {
    width: 100%;
    border-radius: 10px;
}
.provider-gamelist .provider-gamelist-name {
    font-size: 0.85em;
    text-align: center;
}

.provider-image {
    width: 100%;
    border-radius: 10px;
}