/* ==================================
   MINZZ SHOP - General Layout & Component Styles
   ================================== */

/* Root Variables for consistency */
:root {
    --primary-color: #00bfff; /* Contoh warna biru cerah */
    --secondary-color: #333;
    --text-color: #e6f0ff;
    --background-dark: #0d121c;
    --card-background: #1a1a1a;
    --ml-card-background: #1c2738; /* Background spesifik untuk card di halaman game */
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: #2a2a2a;
    --shadow-light: rgba(0, 0, 0, 0.2);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    
    /* Variabel yang hilang yang digunakan di MLID/MLMY Specific styles */
    --text-dim: #b0c2d9; /* Untuk teks sekunder */
    --card: var(--card-background);
    --border: var(--border-color);
    --radius: var(--radius-md);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Mencegah scroll horizontal */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #4dc3ff; /* Lighter shade on hover */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Preloader & Overlay */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
    display: none;
    transition: opacity 0.3s ease;
}

#overlay.active {
    display: block;
    opacity: 1;
}

/* ==================================
   HEADER (Sticky) & PROFILE DROPDOWN
   ================================== */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--background-dark); /* Match body background */
    box-shadow: 0 2px 10px var(--shadow-dark);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    height: 60px; /* Fixed height for header */
}

.left-header, .right-header {
    display: flex;
    align-items: center;
}

.hamburger {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    margin-right: 15px; /* Space between hamburger and logo */
}

.logo img {
    height: 35px; /* Adjust logo size */
    width: auto;
}

.profile-icon img {
    height: 40px; /* Adjust profile icon size */
    width: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.profile-icon img:hover {
    border-color: var(--primary-color);
}

/* --- PROFILE DROPDOWN STYLES (Diperbaiki/Dirapikan) --- */
.profile-dropdown {
    position: absolute;
    top: 60px; 
    right: 10px;
    background: #2a2a2a;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 250px;
    display: none;
    padding: 0; /* Hapus padding luar */
    border: 1px solid #444;
}

.profile-dropdown.show { display: block; }

.profile-dropdown ul { list-style: none; padding: 0; margin: 0; }

.profile-details-box {
    line-height: 1.4;
}
.profile-details-box p {
    margin: 5px 0;
}
.profile-details-box strong {
    font-weight: 600;
}

.profile-dropdown ul li {
    padding: 10px 15px;
    cursor: pointer;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    font-size: 0.95rem; /* Ukuran teks lebih pas */
}

.profile-dropdown ul li:last-child {
    border-bottom: none;
}

.profile-dropdown ul li:hover { background: #3c3c3c; }

.profile-dropdown ul li i { 
    margin-right: 10px; 
    color: var(--primary-color); 
}

.auth-content-box { 
    padding: 10px 15px; 
    margin-bottom: 10px; 
}

.auth-content-box p { 
    margin: 5px 0; 
    font-size: 14px; 
}

.auth-box .btn { 
    display: inline-block; 
    padding: 8px 15px; 
    border-radius: 5px; 
    text-align: center; 
    text-decoration: none; 
    margin-right: 5px; 
    font-size: 14px; 
    font-weight: 600;
}
/* ------------------------------------------------------------------- */


/* ==================================
   SIDEBAR (Dirapikan)
   ================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Hidden by default */
    width: 280px;
    height: 100%;
    background-color: var(--secondary-color);
    box-shadow: 2px 0 10px var(--shadow-dark);
    z-index: 101;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 0; /* Hapus padding atas dan bawah */
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-color);
    font-size: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    gap: 10px;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    color: #ccc; /* Default icon color */
}

.sidebar-menu li a:hover i,
.sidebar-menu li a.active i {
    color: var(--primary-color); /* Icon color on hover/active */
}

/* Specific styling for dynamic auth menu in sidebar */
#dynamicAuthMenu {
    margin-top: auto; /* Push to bottom */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

#dynamicAuthMenu li a {
    /* Tambahkan padding di sini agar menu auth punya spasi dari garis atas */
    padding: 12px 20px;
}

#dynamicAuthMenu .menu-logout a {
    color: #ff4d4d; /* Red for Logout link */
}
#dynamicAuthMenu .menu-logout a i {
    color: #ff4d4d; /* Red for Logout icon */
}


/* ==================================
   MAIN CONTENT
   ================================== */
.main-content {
    padding-top: 60px; /* Offset for sticky header */
    min-height: calc(100vh - 60px); /* Fill remaining viewport height */
}

/* ==================================
   FOOTER (Disesuaikan)
   ================================== */
.footer {
    background-color: #0b111a; 
    color: #b0c2d9;
    padding: 40px 15px 20px; /* Padding samping disamakan dengan konten */
    text-align: left;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px; /* Spasi antar kolom lebih besar */
}

.footer-column, .footer-about, .footer-contact {
    flex: 1 1 200px; /* Flexibel dengan min-width 200px */
    margin-bottom: 20px;
}

.footer-about img {
    margin-bottom: 15px;
}

.footer-about p, .footer-contact p {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.footer-column h4, .footer-contact h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 15px;
    position: relative;
}

.footer-column h4::after, .footer-contact h4::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
    margin-top: 8px;
    /* Tambahkan align-self start untuk memastikan tetap di kiri pada layout flex */
    align-self: flex-start; 
}

.footer-column a {
    display: block;
    color: #b0c2d9;
    margin-bottom: 8px;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-contact p i {
    margin-right: 10px;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: #889bb3;
}

/* Responsive Adjustments for Footer */
@media (max-width: 768px) {
    .footer {
        padding: 30px 15px 15px;
    }
    .footer-container {
        flex-direction: column;
        align-items: flex-start; /* Ubah ke kiri */
        text-align: left; /* Ubah ke kiri */
        gap: 20px;
    }

    .footer-column, .footer-about, .footer-contact {
        flex: 1 1 100%;
        max-width: 100%; /* Hapus batasan max-width */
    }
    
    .footer-column h4::after, .footer-contact h4::after {
        margin: 8px 0 0 0; /* Pindahkan underline ke kiri */
    }
}


/* ==================================
   UTILITIES & GLOBAL COMPONENTS
   ================================== */

/* Section Title */
.section-title {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 25px 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* General Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0099cc;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-full {
    display: block;
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
}

.mb-10 {
    margin-bottom: 10px;
}

/* ==================================
   MLID/MLMY SPECIFIC STYLES
   ================================== */

/* Container Utama pada Halaman Detail Game */
.page-bg {
    padding: 15px;
}
.ml-card {
    background-color: var(--ml-card-background); 
    max-width: 650px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-dark);
}
/* Perbaikan untuk memastikan ada ruang di bagian bawah konten */
.main-content .page-bg > .ml-card {
    margin-bottom: 80px; /* Tambahkan ruang bawah untuk menampung fixed footer */
}

.ml-card .ml-banner img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 180px; /* Batasi tinggi banner */
}
.ml-content {
    padding: 0 15px 15px;
}

/* Perbaikan Tampilan Logo MLBB agar muncul di atas banner sedikit */
.ml-header-details {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-top: 30px; 
}
.ml-header-details .ml-app {
    position: static; 
    width: 80px;
    height: 80px;
    border: 4px solid var(--background-dark); 
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(0,0,0,.6);
    flex-shrink: 0;
    margin-top: -30px; /* Geser ke atas menutupi sedikit banner */
}
.ml-header-details .ml-app img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ml-header-details .ml-headings {
    padding-left: 0; 
    border-bottom: none; 
    margin-bottom: 0;
}
.ml-header-details .ml-title {
    font-size: 24px;
    margin: 0;
    line-height: 1.2;
}
.ml-header-details .ml-publisher {
    font-size: 14px;
    color: #a8b6d1;
}

/* Deskripsi & Info Box */
.ml-description-box {
    background-color: #1a2333;
    border: 1px solid rgba(80,160,255,0.25);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 20px;
    color: var(--text-dim);
    font-size: 14px;
}
.ml-description-box p {
    margin-bottom: 10px;
}
.ml-description-box .show-more-link {
    display: block;
    text-align: right;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

/* Fitur Info */
.ml-info-features {
    margin-bottom: 25px;
}

.ml-info-features .ml-features {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 0;
}
.ml-info-features .ml-features li {
    width: 48%; /* Adjust for 2 columns */
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.ml-info-features .ml-features .fas { /* Font Awesome icons */
    font-size: 16px;
    color: var(--primary-color);
}

/* Section Heading (untuk "Order Form Details", "Choose Amount", dll) */
.section-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 30px 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-heading .fas {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Form Styling */
.form-box {
    background-color: var(--card-background);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--background-dark);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary-color);
}
.form-hint {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 8px;
}
.id-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}


/* Product Tabs (Kategori Diamond/Pass) */
.product-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.product-tabs button {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background-color: #333;
    color: #ccc;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-tabs button.active {
    background-color: var(--primary-color); 
    color: white;
}

/* Diamond Grid & Cards */
.diamond-section.hidden {
    display: none;
}
.diamond-container {
    padding: 15px;
}
.product-section-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.diamond-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.diamond-card {
    background-color: #2a2a2a;
    padding: 15px 10px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}
.diamond-card:hover {
    border-color: #555;
    background-color: #3c3c3c;
}
.diamond-card.active {
    border-color: var(--primary-color);
    background-color: #3c3c3c;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}
.diamond-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.2;
}
.diamond-price {
    font-size: 1rem;
    color: #ffcc00; /* Kuning untuk Harga */
    font-weight: 700;
}


/* Promo Box Styles */
.promo-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}

.promo-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.promo-input-group .form-input {
    flex-grow: 1;
}

.btn-check-promo {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.btn-check-promo:hover {
    background-color: #0099cc;
}

.btn-use-promo {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #383838; /* Darker neutral background */
    color: #eee;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}

.btn-use-promo:hover {
    background-color: #555;
}

/* Payment Grid & Option (Baru) */
.payment-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 15px;
}
.payment-option {
    display: flex;
    align-items: center;
    background-color: #2a3a5a;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent; 
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    gap: 15px;
}
.payment-option.active {
    border-color: var(--primary-color);
    background-color: #2a3a5a; 
    box-shadow: 0 0 8px rgba(0, 191, 255, 0.3);
}
.payment-option:hover {
    background-color: #35466a;
}
.wallet-icon {
    width: 30px; 
    height: 30px; /* Diubah agar lebih konsisten */
    object-fit: contain;
    flex-shrink: 0;
}
.wallet-info { flex-grow: 1; }
.wallet-title { font-weight: 600; color: var(--text-color); }
.wallet-balance { font-size: 0.9rem; color: #ccc; }
.wallet-balance span { color: #ffcc00; font-weight: 700; }

.receipt-note {
    background-color: #1a2a3a;
    border: 1px solid rgba(0,191,255,0.2);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    font-size: 0.85rem;
    color: #9ccfe6;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.receipt-note i {
    color: var(--primary-color);
}

/* Order Preview (Fixed Bottom Bar - Disesuaikan) */
.order-preview {
    position: fixed;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: 650px; /* Batasi lebar maks agar tombol tetap di tengah pada layar besar */
    transform: translateX(-50%) translateY(100%);
    
    background-color: #1a1a1a;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 90;
    transition: transform 0.3s ease;
    border-top-left-radius: var(--radius-md); 
    border-top-right-radius: var(--radius-md);
}

.order-preview.active {
    transform: translateX(-50%) translateY(0);
}
.preview-details {
    display: flex;
    align-items: center;
    gap: 10px;
}
.preview-icon {
    width: 35px;
    height: 35px;
    border-radius: 5px;
}
.preview-text {
    line-height: 1.1;
}
#previewTitle {
    font-size: 0.9rem;
    font-weight: 600;
}
#previewPrice {
    font-size: 1.1rem;
    color: #ffcc00;
    font-weight: 700;
}
.btn-order {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px; /* Padding lebih besar */
    border-radius: var(--radius-sm);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0; 
}
.btn-order:hover {
    background-color: #0099cc;
    transform: translateY(-1px);
}

/* General Modal Styles (Dibiarkan untuk menghindari error jika ada referensi lain) */
.modal {
    display: none !important;
}
.loading-overlay {
    display: none !important;
   }

/* ==================================
   MODAL POP-UP (WELCOME & KONFIRMASI)
   ================================== */

/* --- 1. Modal Container (Latar belakang gelap) --- */
.modal-popup-minzz {
    position: fixed;
    z-index: 10000; /* Pastikan di atas semua z-index lain */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85); /* Lebih gelap */
    display: none; /* Default tersembunyi */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-popup-minzz.show {
    display: flex; /* Ganti dari block ke flex saat show */
    opacity: 1;
}

/* --- 2. Isi Modal (Kotak di tengah) --- */
.modal-popup-content {
    background-color: var(--card-background); 
    padding: 25px;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 380px; 
    box-shadow: 0 8px 30px var(--shadow-dark);
    position: relative;
    animation: fadeInScale 0.3s ease-out;
}

/* --- 3. Tombol Tutup (X) --- */
.close-button-minzz {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-button-minzz:hover,
.close-button-minzz:focus {
    color: var(--primary-color);
}

/* --- 4. Styling Khusus Modal Welcome --- */
.modal-banner-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.modal-title-minzz {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 10px;
    text-align: center;
}

.modal-text-minzz {
    color: var(--text-dim);
    font-size: 1rem;
    text-align: center;
    margin-bottom: 20px;
}

.modal-close-btn-minzz {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-weight: 700;
    transition: background-color 0.2s ease;
}

.modal-close-btn-minzz:hover {
    background-color: #0099cc;
}


/* --- 5. Styling untuk Pop-up Konfirmasi Transaksi (Opsional/General) --- */
.confirmation-content h4 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}
.confirmation-content p {
    color: var(--text-dim);
    margin-bottom: 20px;
}
.confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.btn-cancel {
    background-color: #383838;
    color: #fff;
}
.btn-cancel:hover {
    background-color: #555;
}
.btn-confirm {
    background-color: #ff4d4d; /* Warna Aksi Kritis */
    color: white;
}
.btn-confirm:hover {
    background-color: #cc3c3c;
}


/* --- 6. Animasi --- */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
