/* ============================================================
   Xin88 Theme — Main CSS
   Casino-style: Japanese Sakura Gold (Xin88 brand)
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
    background: #0d0d0d;
    color: #e0e0e0;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Utilities ---- */
.desktop-only { display: block; }
.mobile-only  { display: none; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s ease;
    white-space: nowrap;
    text-decoration: none;
}
.btn-register {
    background: linear-gradient(135deg, #c0143c, #8b0028);
    color: #fff;
    border-color: #c0143c;
	padding: 32px 20px;
}
.btn-register:hover { background: linear-gradient(135deg, #d4254d, #a01030); }

.btn-login {
    background: transparent;
    color: #e0e0e0;
    border-color: #555;
	padding: 32px 20px;
}
.btn-login:hover { border-color: #d4347a; color: #d4347a; }

.btn-login-outline {
    background: transparent;
    color: #d4347a;
    border: 2px solid #d4347a;
}
.btn-login-outline:hover { background: #d4347a; color: #0d0d0d; }

.btn-outline {
    background: transparent;
    color: #d4347a;
    border: 1px solid #d4347a;
    padding: 8px 20px;
}
.btn-outline:hover { background: #d4347a; color: #0d0d0d; }

.btn-apk {
    background: linear-gradient(135deg, #d4347a, #a0205a);
    color: #0d0d0d;
    border-color: #d4347a;
    font-size: 13px;
}
.btn-apk:hover { background: linear-gradient(135deg, #e85a9a, #d4347a); }

.btn-promo {
    background: linear-gradient(135deg, #c0143c, #8b0028);
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    display: inline-block;
    margin-top: 12px;
}
.btn-promo:hover { background: linear-gradient(135deg, #d4254d, #a01030); }

.btn-full { width: 100%; }

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #111;
    border-bottom: 1px solid #222;
    box-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
}
.site-logo img { height: 36px; width: auto; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.nav-link {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #ccc;
    transition: color .2s, background .2s;
    white-space: nowrap;
}
.nav-link:hover { color: #d4347a; background: rgba(212,52,122,.08); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.header-actions .btn { padding: 7px 16px; font-size: 13px; }

/* Mobile hamburger */
.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 4px;
    display: none;
}
.mobile-menu-btn svg { width: 24px; height: 24px; fill: currentColor; }

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 1100;
}
.mobile-overlay.open { display: block; }

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #111;
    z-index: 1200;
    transition: left .3s ease;
    overflow-y: auto;
    padding-bottom: 80px;
}
.mobile-drawer.open { left: 0; }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #222;
}
.drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 4px;
}
.drawer-close svg { width: 22px; height: 22px; fill: currentColor; }

.drawer-nav {
    padding: 12px 0;
}
.drawer-link {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    font-size: 15px;
    border-bottom: 1px solid #1a1a1a;
    transition: color .2s, background .2s;
}
.drawer-link:hover { color: #d4347a; background: rgba(212,52,122,.06); }

.drawer-actions {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================================
   PAGE LAYOUT (Main + Sidebar)
   ============================================================ */
#page-wrap { min-height: 60vh; }

.page-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 40px;
    align-items: start;
}

.main-content { min-width: 0; }

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero-section {
    position: relative;
    background: #0d0d0d;
    overflow: hidden;
}

/* ---- Desktop hero ---- */
.hero-desktop {
    display: block;
    position: relative;
    width: 100%;
    line-height: 0;
    overflow: hidden;
}
.hero-desktop-img-wrap {
    position: relative;
    width: 100%;
    line-height: 0;
}
.hero-img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

/* Desktop text overlay */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    pointer-events: none;
}
.hero-overlay-inner {
    pointer-events: auto;
    max-width: 1200px;
	margin: 150px auto;
	width: 80%;
}
.hero-h1 {
    font-size: 38px;
    font-weight: 900;
    color: #f0c040;
    line-height: 1.2;
    margin: 0 0 12px;
    text-shadow: 2px 2px 8px rgba(0,0,0,.8);
}
.hero-h1 strong {
    color: #ffffff;
    display: block;
}
.hero-subtitle {
    font-size: 14px;
    color: #ddd;
    line-height: 1.65;
    margin: 0 0 20px;
    text-shadow: 1px 1px 4px rgba(0,0,0,.9);
    max-width: 420px;
}
.hero-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- Mobile hero (hidden on desktop) ---- */
.hero-mobile {
    display: none !important;
    flex-direction: column;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a0800 60%, #0d0d0d 100%);
}
.hero-mobile-text {
    padding: 20px 16px 0;
}
.hero-mobile-h1 {
    font-size: 32px;
    font-weight: 900;
    color: #f0c040;
    line-height: 1.25;
    margin-bottom: 10px;
	position: absolute;
    margin-top: 20px;
}
.hero-mobile-h1 strong { color: #fff; }
.hero-mobile-subtitle {
    font-size: 16px;
    color: #bbb;
    line-height: 1.6;
    margin-bottom: 0;
	position: absolute;
    margin-top: 200px;
}
.hero-mobile-img-wrap {
    width: 100%;
    line-height: 0;
}
.hero-mobile-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.hero-mobile-btns {
    display: flex;
    gap: 10px;
    padding: 14px 16px 18px;
/*     background: #212121; */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 45%), radial-gradient(circle at center, rgba(13, 13, 13, 0.7) 0%, rgba(13, 13, 13, 0.4) 60%, rgba(13, 13, 13, 0.1) 100%) !important;
	position: absolute;
    bottom: 0;
    width: 100%;
}
.hero-mobile-btns .btn {
    flex: 1;
    font-size: 15px;
    padding: 12px 10px;
    font-weight: 800;
    letter-spacing: .3px;
}

/* Legacy — keep for backward compat */
.hero-content { display: none; }

/* ============================================================
   TRUST BAR
   ============================================================ */
.trust-bar {
    background: #161616;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    padding: 12px 0;
}
.trust-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #bbb;
}
.trust-item .icon-sm { width: 18px; height: 18px; color: #d4347a; flex-shrink: 0; }

/* ============================================================
   SECTION COMMON
   ============================================================ */
.provider-section,
.why-section,
.games-section,
.promo-section,
.banking-section,
.content-section,
.faq-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 22px;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1e1e1e;
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #d4347a;
}

.section-label {
    text-align: center;
    font-size: 13px;
    letter-spacing: 4px;
    color: #d4347a;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ============================================================
   PROVIDER MARQUEE
   ============================================================ */
.provider-section { overflow: hidden; }

.provider-track-wrap {
    overflow: hidden;
    position: relative;
}
.provider-track-wrap::before,
.provider-track-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
}
.provider-track-wrap::before { left: 0; background: linear-gradient(to right, #0d0d0d, transparent); }
.provider-track-wrap::after  { right: 0; background: linear-gradient(to left, #0d0d0d, transparent); }

.provider-track {
    display: flex;
    gap: 12px;
    animation: marquee 20s linear infinite;
    width: max-content;
}
.provider-track:hover { animation-play-state: paused; }

@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.provider-item {
    flex-shrink: 0;
    display: block;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .2s;
}
.provider-item:hover { border-color: #d4347a; }
.provider-item img {
    width: 160px;
    height: 80px;
    object-fit: contain;
    padding: 8px;
}

/* ============================================================
   WHY US
   ============================================================ */
.why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.why-card {
    background: #161616;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 20px;
    transition: border-color .2s, transform .2s;
}
.why-card:hover { border-color: #d4347a; transform: translateY(-2px); }
.why-icon { margin-bottom: 12px; }
.why-icon .icon-md { width: 32px; height: 32px; color: #d4347a; }
.why-h3 {
    font-size: 15px;
    color: #d4347a;
    margin-bottom: 8px;
}
.why-text { font-size: 13px; color: #999; line-height: 1.6; }

/* ============================================================
   GAMES GRID
   ============================================================ */
.games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.game-card {
    display: block;
    text-align: center;
    transition: transform .2s;
}
.game-card:hover { transform: translateY(-4px); }
.game-thumb {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1/1;
    background: #1a1a1a;
}
.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.game-card:hover .game-thumb img { transform: scale(1.05); }

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}
.game-card:hover .game-overlay { opacity: 1; }
.game-play-btn {
    background: #c0143c;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}
.game-name {
    font-size: 12px;
    color: #ccc;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.games-more { text-align: center; margin-top: 8px; }

/* ============================================================
   PROMOTION
   ============================================================ */
.promo-card {
    display: flex;
    gap: 20px;
    background: #161616;
    border: 1px solid #222;
    border-radius: 12px;
    overflow: hidden;
}
.promo-img-wrap {
    flex-shrink: 0;
    width: 280px;
}
.promo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.promo-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.promo-badge {
    display: inline-block;
    background: #c0143c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.promo-h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
}
.promo-text { font-size: 13px; color: #999; line-height: 1.6; }

/* ============================================================
   BANKING
   ============================================================ */
.banking-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.bank-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bank-color, #333);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    min-width: 80px;
    justify-content: center;
}
.bank-item img { width: 22px; height: 22px; object-fit: contain; }
.bank-name-fallback { font-size: 12px; }
.bank-label { font-size: 12px; }

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content-section {
    background: #161616;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    padding: 24px;
}
.breadcrumbs {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}
.breadcrumbs-link { color: #d4347a; }
.breadcrumbs-link:hover { text-decoration: underline; }

.content-h1 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.4;
}
.content-article {
    font-size: 14px;
    color: #aaa;
    line-height: 1.8;
}
.content-article p { margin-bottom: 12px; }
.content-article h2 { font-size: 17px; color: #d4347a; margin: 20px 0 10px; }
.content-article h3 { font-size: 15px; color: #ddd; margin: 16px 0 8px; }
.content-article h4, .content-article h5, .content-article h6 { color: #ccc; margin: 12px 0 6px; }
.content-article a { color: #d4347a; }
.content-article a:hover { text-decoration: underline; }
.content-article strong { color: #e0e0e0; }
.content-article ul, .content-article ol { padding-left: 20px; margin-bottom: 12px; }
.content-article ul li { list-style: disc; }
.content-article ol li { list-style: decimal; }

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
    background: #161616;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .2s;
}
.faq-item[open] { border-color: #d4347a; }

.faq-q {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
    content: '+';
    font-size: 20px;
    color: #d4347a;
    flex-shrink: 0;
    transition: transform .2s;
}
.faq-item[open] .faq-q::after { transform: rotate(45deg); }

.faq-a {
    padding: 0 18px 14px;
    font-size: 13px;
    color: #999;
    line-height: 1.7;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.page-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.page-sidebar .btn { 
	font-size: 14px; 
	padding: 10px;
}

.sidebar-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #161616;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 14px;
    margin-top: 4px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}
.stat-icon .icon-xs { width: 20px; height: 20px; color: #d4347a; }
.stat-text { font-size: 11px; color: #888; }

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
    background: #0a0a0a;
    border-top: 1px solid #1e1e1e;
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-inner {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.footer-brand { flex: 0 0 220px; }
.footer-logo img { height: 34px; width: auto; margin-bottom: 12px; }
.footer-desc { font-size: 13px; color: #666; line-height: 1.6; }

.footer-menus {
    display: flex;
    gap: 40px;
    flex: 1;
    flex-wrap: wrap;
}
.footer-menu-col { min-width: 120px; }
.footer-menu-title {
    font-size: 13px;
    font-weight: 700;
    color: #d4347a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.footer-menu-list li { margin-bottom: 8px; }
.footer-link { font-size: 13px; color: #666; transition: color .2s; }
.footer-link:hover { color: #d4347a; }

.footer-bottom {
    border-top: 1px solid #1a1a1a;
    padding-top: 16px;
    text-align: center;
}
.footer-copyright { font-size: 12px; color: #444; }

/* ============================================================
   FIXED MOBILE FOOTER
   ============================================================ */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #111;
    border-top: 1px solid #222;
    display: flex;
    z-index: 900;
    box-shadow: 0 -2px 12px rgba(0,0,0,.5);
}
.fixed-footer-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    color: #666;
    font-size: 10px;
    gap: 3px;
    transition: color .2s;
    text-decoration: none;
}
.fixed-footer-item.active,
.fixed-footer-item:hover { color: #d4347a; }
.fixed-footer-icon svg { width: 20px; height: 20px; fill: currentColor; }
.fixed-footer-label { font-size: 10px; }

/* ============================================================
   PAGE / SINGLE CONTENT
   ============================================================ */
.content-section-wrap {
    padding: 24px 0;
}
.content-section-wrap .entry-title {
    font-size: 22px;
    color: #fff;
    margin-bottom: 16px;
}
.content-section-wrap .entry-content {
    font-size: 14px;
    color: #aaa;
    line-height: 1.8;
}
.content-section-wrap .entry-content p { margin-bottom: 14px; }
.content-section-wrap .entry-content h2 { font-size: 18px; color: #d4347a; margin: 20px 0 10px; }
.content-section-wrap .entry-content h3 { font-size: 16px; color: #ddd; margin: 16px 0 8px; }
.content-section-wrap .entry-content a { color: #d4347a; }

/* 404 */
.error-404-wrap {
    text-align: center;
    padding: 80px 20px;
}
.error-404-wrap h1 { font-size: 80px; color: #d4347a; }
.error-404-wrap p { color: #888; margin: 12px 0 24px; }

/* ============================================================
   RESPONSIVE — Tablet (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
    .page-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        order: -1; /* แสดง sidebar ก่อน main บน mobile */
    }
    .sidebar-stats {
        grid-column: 1 / -1;
    }
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .why-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 767px)
   ============================================================ */
@media (max-width: 767px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: flex !important; }

    /* Header */
    .header-inner { height: 54px; }
    .header-actions .btn-login,
    .header-actions .btn-register { display: none; }
    .mobile-menu-btn { display: flex; }

    /* Hero — mobile: ซ่อน desktop, แสดง mobile layout */
    .hero-desktop { display: none !important; }
    .hero-mobile  { display: flex !important; }
    .hero-mobile-h1 { font-size: 32px; }

    /* Trust Bar — 2×2 grid บน mobile */
    .trust-bar-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 16px;
        justify-items: start;
    }
    .trust-item { font-size: 12px; }

    /* Page layout */
    .page-layout { padding-top: 16px; }

    /* Sidebar mobile — stack vertically */
    .page-sidebar {
        grid-template-columns: 1fr;
        order: 0;
    }

    /* Provider */
    .provider-item img { width: 120px; height: 60px; }

    /* Why Us */
    .why-grid { grid-template-columns: 1fr; }

    /* Games */
    .games-grid { grid-template-columns: repeat(2, 1fr); }

    /* Promo */
    .promo-card { flex-direction: column; }
    .promo-img-wrap { width: 100%; max-height: 100%; overflow: hidden; }
    .promo-body { padding: 16px; }

    /* Banking */
    .banking-grid { gap: 8px; }
    .bank-item { padding: 5px 10px; font-size: 11px; }

    /* Content */
    .content-section { padding: 16px; }
    .content-h1 { font-size: 16px; }

    /* Footer */
    .footer-inner { flex-direction: column; gap: 24px; }
    .footer-brand { flex: none; }
    .footer-menus { gap: 24px; }

    /* Fixed footer padding */
    body { padding-bottom: 60px; }
}

/* ============================================================
   RESPONSIVE — Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    .hero-mobile-h1 { font-size: 32px; }
    .games-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    /* Trust bar — ยังคง  2 คอลัมน์บนหน้าจอเล็ก */
    .trust-bar-inner {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
}
