/* ==========================================================================
   1. GLOBAL & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   2. MOBILE UI STYLES (DEFAULT - Untuk Skrin Telefon Pintar)
   ========================================================================== */
.site-container {
    width: 100%;
    max-width: 480px; /* Had bingkai mudah alih mengikut gambar 1 */
    background-color: #ffffff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative;}

/* Kawalan Element Mudah Alih */
.desktop-only-view {
    display: none !important;
}

.mobile-only-view {
    display: block;
}

/* --- Header Mobile --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-btn {
    font-size: 24px;
    color: #333;
    cursor: pointer;
    background: none;
    border: none;
}

.logo {
    height: 25px;
    display: flex;
    align-items: center;
}

.logo img {
    height: 100%;
    object-fit: contain;
}

.header-wa-btn {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    text-decoration: none;
}

.desktop-nav {
    display: none; /* Sembunyikan navigasi PC di telefon */
}

/* --- Main Content Mobile --- */
main {
    padding: 15px;
}

/* Kotak Hero Biru Muda Pasif (Sama seperti Gambar 1) */
.hero-layout-container {
    background-color: #E6FAFF;
    border-radius: 20px;
    padding: 20px 15px;
    text-align: center;
    margin-bottom: 20px;
}

.hero-mobile-image {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 15px auto;
    display: block;
}

.hero-layout-container h1 {
    font-size: 20px;
    font-weight: 800;
    color: #000;
    margin-bottom: 12px;
    text-align: left;
    padding: 0 5px;
}

.hero-layout-container p {
    font-size: 12px;
    color: #444;
    text-align: left;
    margin-bottom: 20px;
    padding: 0 5px;
    line-height: 1.6;
}

/* Susunan Butang CTA Mobile (Play Now & WhatsApp Bersebelahan) */
.cta-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 5px;
}

.play-now-img-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.play-now-img-btn img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.whatsapp-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #25D366;
    color: white;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border-radius: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 44px; /* Dipadankan dengan ketinggian visual Butang Play Now Imej */
}

/* Kad Info Merah Jambu */
.info-card {
    background-color: #FFE6FF;
    border-radius: 15px;
    padding: 20px 15px;
    margin-top: 15px;
}

.info-card h1 {
    font-size: 20px;
    font-weight: 800;
    color: #000;
    margin-bottom: 12px;
    line-height: 1.3;
}

.info-card h2 {
    font-size: 15px;
    font-weight: 800;
    color: #000;
    margin: 18px 0 10px;
    line-height: 1.4;
}

.info-card h2:first-child {
    margin-top: 0;
}

.info-card h3 {
    font-size: 13.5px;
    font-weight: 700;
    color: #000;
    margin: 14px 0 8px;
    line-height: 1.4;
}

.info-card p {
    font-size: 11.5px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-card ul {
    margin: 0 0 15px 16px;
    padding: 0;
}

.info-card ul li {
    font-size: 11.5px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 6px;
}

.info-card table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 11px;
}

.info-card table th,
.info-card table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.info-card table th {
    background-color: rgba(255,255,255,0.5);
    font-weight: 700;
}

.info-card .note {
    background-color: rgba(255,255,255,0.6);
    border-left: 3px solid #d69ad6;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-style: italic;
    margin-bottom: 15px;
}

.info-card ol {
    margin: 0 0 15px 16px;
    padding: 0;
}

.info-card ol li {
    font-size: 11.5px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 6px;
}

.info-card .content-img {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.info-card pre {
    background-color: rgba(0,0,0,0.85);
    color: #f5f5f5;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 11px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.info-card pre code {
    background: none;
    padding: 0;
}

.info-card p code {
    background-color: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

/* --- Struktur Sidebar Mobile Menu --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: #ffffff;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-menu.active { left: 0; }
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}
.sidebar-header .logo img { height: 25px; object-fit: contain; }
.close-btn { font-size: 24px; background: none; border: none; color: #333; cursor: pointer; }
.sidebar-links { list-style: none; padding: 20px 0; }
.sidebar-links li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #f5f5f5;
}

/* --- Nav Current Page Indicator (Mobile Sidebar) --- */
.sidebar-links a.nav-current,
.submenu-toggle a.nav-current {
    color: #0052cc;
    border-left: 3px solid #0052cc;
    background-color: #f0f6ff;
}

/* --- Sidebar Submenu Accordion (Parent > Child mengikut struktur folder) --- */
.sidebar-links li.has-submenu {
    border-bottom: 1px solid #f5f5f5;
}

.submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
}

.submenu-toggle a {
    flex: 1;
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}

.submenu-arrow {
    background: none;
    border: none;
    padding: 12px 20px;
    color: #999;
    cursor: pointer;
}

.submenu-arrow i {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.has-submenu.open .submenu-arrow i {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    background-color: #fafafa;
    transition: max-height 0.3s ease;
}

.has-submenu.open .submenu {
    max-height: 400px;
}

.submenu li a {
    padding: 12px 20px 12px 35px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}

.submenu li:last-child a {
    border-bottom: none;
}

/* ==========================================================================
   3. COMPUTER UI STYLES (RESPONSIVE TRANSITION - Lebar Skrin Komputer > 768px)
   ========================================================================== */
@media screen and (min-width: 768px) {
    
    /* Buka had lebar mobile kontainer untuk mod skrin penuh komputer */
    .site-container {
        max-width: 100%;
        box-shadow: none;
    }

    /* Urus kebolehlihatan elemen komputer */
    .desktop-only-view {
        display: flex !important;
    }

    .mobile-only-view {
        display: none !important;
    }

    /* --- Header PC (Sama seperti gambar PC) --- */
    header {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
        border-bottom: none;
    }

    .menu-btn {
        display: none !important; /* Buang butang hamburger di PC */
    }

    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 35px;
    }

    .desktop-nav a {
        color: #666;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .desktop-nav a:hover {
        color: #0052cc;
    }

    /* --- Desktop Dropdown (Parent > Child mengikut struktur folder) --- */
    .nav-dropdown {
        position: relative;
    }

    .nav-dropdown-toggle {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .nav-dropdown-arrow {
        font-size: 11px;
        transition: transform 0.2s ease;
    }

    .nav-dropdown:hover .nav-dropdown-toggle,
    .nav-dropdown.active .nav-dropdown-toggle {
        color: #0052cc;
    }

    .nav-dropdown:hover .nav-dropdown-arrow,
    .nav-dropdown.active .nav-dropdown-arrow {
        transform: rotate(180deg);
    }

    .nav-dropdown-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 15px);
        left: 0;
        min-width: 200px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.12);
        padding: 8px 0;
        z-index: 50;
    }

    /* Invisible bridge so the pointer stays within the hover chain while crossing the gap above the menu */
    .nav-dropdown-menu::before {
        content: "";
        position: absolute;
        top: -15px;
        left: 0;
        width: 100%;
        height: 15px;
    }

    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown.active .nav-dropdown-menu {
        display: flex;
    }

    .nav-dropdown-menu a {
        padding: 10px 20px;
        white-space: nowrap;
    }

    .nav-dropdown-menu a:hover {
        background-color: #f5f5f5;
    }

    /* --- Nav Current Page Indicator (Desktop) --- */
    .desktop-nav > a.nav-current,
    .nav-dropdown-toggle.nav-current {
        color: #0052cc;
        font-weight: 700;
    }

    .nav-dropdown-menu a.nav-current {
        color: #0052cc;
        font-weight: 700;
        background-color: #f0f6ff;
    }

    .header-wa-btn {
        width: 42px;
        height: 42px;
        font-size: 24px;
        border-radius: 50%; /* Bulat penuh di PC */
    }

    /* --- Main Layout PC --- */
    main {
        max-width: 1200px;
        margin: 0 auto;
        padding: 40px 20px;
    }

    /* Kad biru bertukar kepada susunan 2-Lajur sebelah menyebelah di PC */
    .hero-layout-container {
        background-color: transparent; /* Buang latar belakang biru penuh di PC */
        border-radius: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 50px;
        width: 100%;
        min-height: 480px;
        margin-bottom: 50px;
    }

    /* Lajur Kiri: Teks & Butang */
    .hero-content-col {
        flex: 1.2;
        text-align: left;
    }

    .hero-layout-container h1 {
        font-size: 42px;
        font-weight: 800;
        line-height: 1.25;
        color: #111;
        margin-bottom: 25px;
        padding: 0;
    }

    .hero-layout-container p {
        font-size: 15px;
        color: #555;
        line-height: 1.7;
        margin-bottom: 35px;
        padding: 0;
    }

    /* Lajur Kanan: Banner Reka Bentuk Visual Grafik Telefon */
    .hero-graphics-col {
        flex: 0.8;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Kesan Background Biru Pudar Halus di belakang grafik telefon di PC (Sama seperti gambar PC) */
    .desktop-banner-radial-bg {
        background: radial-gradient(circle, rgba(230,250,255,0.9) 0%, rgba(255,255,255,0) 70%);
        padding: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .hero-desktop-image {
        width: 100%;
        max-width: 440px;
        height: auto;
        display: block;
        object-fit: contain;
    }

    /* Susunan 3 Butang CTA Mendatar untuk Skrin Komputer */
    .cta-group {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
        padding: 0;
    }

    .cta-group .play-now-img-btn {
        flex: none;
        width: 180px;
    }

    /* Butang Apple Putih Minimalis PC */
    .ios-download-minimal-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background-color: #ffffff;
        color: #333;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 12px 24px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        height: 46px;
        transition: background-color 0.2s ease;
    }
    .ios-download-minimal-btn:hover { background-color: #f9f9f9; }

    /* Butang Biru Casino PC */
    .online-casino-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(to bottom, #29abe2, #0071bc);
        color: #ffffff;
        border-radius: 8px;
        padding: 12px 24px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        box-shadow: 0 3px 10px rgba(0, 113, 188, 0.3);
        height: 46px;
        transition: opacity 0.2s ease;
    }
    .online-casino-btn:hover { opacity: 0.9; }

    /* Penyesuaian Kad Info untuk Skrin Komputer PC */
    .info-card {
        padding: 30px;
        border-radius: 20px;
    }
    .info-card h1 { font-size: 30px; }
    .info-card h2 { font-size: 20px; margin-bottom: 15px; }
    .info-card h3 { font-size: 16px; }
    .info-card p,
    .info-card ul li,
    .info-card ol li,
    .info-card table { font-size: 14px; }
}

/* ==========================================================================
   CSS TAMBAHAN UNTUK ELEMEN SKROL MELINTANG SUBPAGE DI MOBILE UI
   ========================================================================== */
.subpage-app-icon {
    width: 90px;
    height: auto;
    margin: 0 auto 15px auto;
    display: block;
}

/* Kontainer Utama yang Membolehkan Skrol Melintang (Swipe Left/Right) */
.subpage-download-container {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
    overflow-x: auto; 
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* Skrol lancar peranti native */
    scrollbar-width: none; /* Sembunyikan scrollbar di Firefox */
    padding: 5px 0 15px 0; /* Mengelakkan bayang shadow daripada terpotong */
}

/* Sembunyikan bar skrol untuk Chrome, Safari dan Opera */
.subpage-download-container::-webkit-scrollbar {
    display: none;
}

/* Gaya Kotak Kad Muat Turun Jenis Kapsul Cerunan & Bayang Lembut */
.subpage-download-box {
    flex: 0 0 75%; /* Menetapkan saiz tetap kotak semasa diskrol melintang */
    max-width: 260px;
    border-radius: 20px;
    padding: 18px 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.subpage-android-box {
    background: linear-gradient(to bottom, #ffffff, #f0faf4);
}

.subpage-ios-box {
    background: linear-gradient(to bottom, #ffffff, #fff0f3);
    margin-right: 15px; /* Jarak ruang kosong di hujung selepas skrol habis */
}

.subpage-os-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.subpage-android-text { color: #237a3c; }
.subpage-ios-text { color: #b83232; }

.subpage-os-subtitle {
    font-size: 10.5px;
    color: #555;
    margin-bottom: 16px;
}

.subpage-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 30px;
    text-align: center;
    letter-spacing: 0.3px;
    transition: transform 0.2s ease;
}

.subpage-android-btn {
    background: linear-gradient(to right, #1ebd55, #12a641);
    box-shadow: 0 5px 15px rgba(18, 166, 65, 0.4);
}

.subpage-ios-btn {
    background: linear-gradient(to right, #ff3b30, #ff7b00);
    box-shadow: 0 5px 15px rgba(255, 59, 48, 0.4);
}

.subpage-download-btn:active {
    transform: scale(0.97);
}

/* ==========================================================================
   CSS UNTUK PEMUSATAN KOTAK ANDROID TUNGGAL DI SUBPAGE MOBILE UI
   ========================================================================== */
.subpage-single-container {
    display: flex;
    justify-content: center; /* Memastikan butang ditolak ke tengah paksi mendatar */
    align-items: center;
    width: 100%;
    margin-bottom: 25px;
    padding: 5px 0 15px 0;
}

/* Mengunci lebar maksimum kotak Android tunggal agar kekal stabil di tengah */
.subpage-single-container .subpage-download-box {
    flex: 0 1 100%;
    max-width: 280px;
}

/* ==========================================================================
   4. FOOTER
   ========================================================================== */
.site-footer {
    background-color: #0d1b2a;
    color: #ffffff;
    text-align: center;
    padding: 16px 15px;
    font-size: 12px;
}

@media screen and (min-width: 768px) {
    .site-footer {
        font-size: 14px;
        padding: 20px;
    }
}