/* Definisi Warna Tema Hijau Daun & Tambahan Ungu Gift */
:root {
    --leaf-primary: #4CAF50; /* Hijau Daun Utama */
    --leaf-dark: #2E7D32;    /* Hijau Tua */
    --leaf-light: #E8F5E9;   /* Hijau Sangat Muda (Background) */
    --leaf-hover: #45a049;
    --gift-purple: #8b5cf6;  /* Warna Ungu untuk Fitur Gift */
    --gift-light: #f5f3ff;   /* Ungu Sangat Muda untuk Background Tab Gift */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    color: #333;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: #ffffff;
    min-height: 100vh;
    min-height: 100dvh; /* Support Modern Device Viewport */
    position: relative;
    padding-bottom: 90px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    overflow-x: hidden;
}

/* Header & Actions */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-bottom: 2px solid var(--leaf-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--leaf-primary);
    padding: 1px;
}

.header-title h1 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--leaf-dark);
}

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

.action-btn {
    font-size: 1.2rem;
    color: var(--leaf-dark);
    cursor: pointer;
    padding: 4px;
    transition: 0.2s;
}

.cart-btn-container {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    background: #e65100;
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
    display: none;
}

.back-btn {
    font-size: 1.1rem;
    color: #666;
    cursor: pointer;
}

/* Banner Promo Gambar */
.promo-banner-container {
    padding: 12px 15px 0 15px;
}

.promo-banner {
    width: 100%;
    border-radius: 10px;
    display: block;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* --- Tombol Saluran WhatsApp di Header (Aestetik) --- */
.saluran-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #e8f5e9; /* Hijau muda lembut senada tema web */
    color: #25D366;      /* Warna hijau ikon WhatsApp */
    font-size: 1.15rem;
    border-radius: 50%;
    text-decoration: none;
    border: 1px solid rgba(37, 211, 102, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efek transisi halus saat disentuh kursor di desktop */
.saluran-header-btn:hover {
    background: #25D366;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

/* Efek membal responsif saat ditekan di HP */
.saluran-header-btn:active {
    transform: scale(0.92);
}

/* Rating Banner */
.rating-banner {
    display: flex;
    justify-content: space-between;
    background-color: var(--leaf-primary);
    color: white;
    padding: 10px 15px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 10px;
}

.click-btn {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 5px;
    transition: 0.2s;
}

.click-btn:hover { background: rgba(255, 255, 255, 0.4); }

.content { padding: 15px; }
.section { margin-bottom: 22px; }
.section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; color: var(--leaf-dark); }
.section-subtitle { font-size: 0.8rem; color: #666; margin-bottom: 12px; line-height: 1.4; }

/* Tabs Jenis (Mendukung 3 kolom tab responsif) */
.type-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { flex: 1; min-width: 120px; border: 1px solid #ddd; border-radius: 10px; padding: 10px 8px; cursor: pointer; position: relative; transition: all 0.2s; background: #fafafa; }

/* States Warna Aktif Masing-masing Tab */
.tab#tab-pending.active { border-color: var(--leaf-primary); background: var(--leaf-light); box-shadow: 0 4px 10px rgba(76, 175, 80, 0.15); }
.tab#tab-instant.active { border-color: #1976d2; background: #e3f2fd; box-shadow: 0 4px 10px rgba(25, 118, 210, 0.15); }
.tab#tab-gift.active { border-color: var(--gift-purple); background: var(--gift-light); box-shadow: 0 4px 10px rgba(139, 92, 246, 0.15); }

.tab .badge { position: absolute; top: -10px; left: 8px; font-size: 0.6rem; color: white; padding: 2px 6px; border-radius: 10px; font-weight: bold; white-space: nowrap; }
.badge.red { background-color: #d32f2f; }
.badge.blue { background-color: #1976d2; }
.badge.purple { background-color: var(--gift-purple); }

.tab-content { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; gap: 4px; }
.tab h3 { font-size: 0.78rem; margin-bottom: 2px; color: #333; font-weight: 700; }
.tab p { font-size: 0.65rem; color: #666; line-height: 1.2; }
.icon-green { color: var(--leaf-primary); font-size: 1.15rem; }
.icon-blue { color: #1976d2; font-size: 1.15rem; }

/* Info Warning Box */
.warning-box { background: #fff3cd; color: #856404; padding: 10px; border-radius: 8px; font-size: 0.78rem; margin-top: 10px; border: 1px solid #ffeeba; line-height: 1.4; }

/* Inputs (Penting: Font 16px mencegah auto-zoom iOS Safari) */
.input-group { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; background: #fff; transition: 0.3s; }
.input-group:focus-within { border-color: var(--leaf-primary); box-shadow: 0 0 5px rgba(76, 175, 80, 0.3); }
.input-icon { color: var(--leaf-primary); margin-right: 10px; font-size: 1.1rem; }
.input-group input { border: none; outline: none; width: 100%; font-size: 16px; color: #333; }

/* Custom Robux Box */
.custom-input-box { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; margin-bottom: 15px; }
.custom-input-box:focus-within { border-color: var(--leaf-primary); }
.input-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px dashed #ddd; background: #fff; }
.input-row input { border: none; outline: none; font-size: 16px; width: 80%; font-weight: 600; }
.input-row span { font-size: 0.9rem; color: var(--leaf-dark); font-weight: bold; }
.price-row { padding: 10px 12px; background: var(--leaf-light); color: var(--leaf-dark); font-weight: bold; font-size: 1.05rem; }

.divider { text-align: center; margin: 15px 0; position: relative; }
.divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px dashed #ccc; z-index: 1; }
.divider span { background: #fff; padding: 0 10px; color: #888; font-size: 0.75rem; position: relative; z-index: 2; }

/* Grid Produk */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-card { border: 1px solid #ddd; border-radius: 8px; padding: 12px; cursor: pointer; position: relative; background: #fff; transition: 0.2s; }
.product-card.selected { border-color: var(--leaf-primary); background: var(--leaf-light); box-shadow: 0 4px 10px rgba(76, 175, 80, 0.2); transform: translateY(-1px); }
.product-card .rbx-amount { display: flex; align-items: center; gap: 5px; font-weight: bold; font-size: 0.95rem; margin-bottom: 10px; }
.product-card .rbx-amount i { color: #f5b041; }
.product-card .price { font-weight: bold; font-size: 0.95rem; color: var(--leaf-dark); }

/* QRIS Method */
.payment-card { border: 1px solid var(--leaf-primary); background: var(--leaf-light); border-radius: 8px; padding: 12px; display: flex; align-items: center; gap: 12px; }
.qris-logo { height: 22px; }
.payment-card p { flex: 1; font-size: 0.85rem; font-weight: 600; color: var(--leaf-dark); }
.check-icon { color: var(--leaf-primary); font-size: 1.1rem; }

/* Bottom Bar Dashboard */
.bottom-bar { position: fixed; bottom: 0; width: 100%; max-width: 480px; background: #fff; padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #ddd; box-shadow: 0 -4px 12px rgba(0,0,0,0.05); z-index: 150; }
.total-info span { font-size: 0.75rem; color: #666; }
.total-info h3 { color: #e65100; font-size: 1.15rem; margin-top: 2px; }
.bottom-buttons { display: flex; gap: 8px; align-items: center; }

.buy-btn { background: var(--leaf-primary); color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 0.95rem; cursor: pointer; transition: 0.2s; box-shadow: 0 3px 8px rgba(76, 175, 80, 0.25); }
.buy-btn:hover { background: var(--leaf-hover); }

.cart-add-btn { background: #f0f2f5; color: var(--leaf-dark); border: 1px solid #ddd; padding: 12px 14px; border-radius: 8px; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.cart-add-btn:hover { background: var(--leaf-light); }

/* --- MODAL DASAR --- */
.modal { display: none; position: fixed; z-index: 300; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); justify-content: center; align-items: center; padding: 15px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* Modal Content Putih (Cara Beli) */
.modal-content { background-color: #fff; padding: 20px; border-radius: 12px; width: 100%; max-width: 400px; position: relative; border: 3px solid var(--leaf-primary); box-shadow: 0 10px 25px rgba(0,0,0,0.2); animation: popIn 0.25s ease-out; }
.close-btn { position: absolute; right: 12px; top: 10px; font-size: 26px; cursor: pointer; color: #aaa; }

/* Modal Content Gelap Premium (QRIS, Keranjang, Riwayat) */
.modal-content-dark { background-color: #0d1117; color: #ffffff; border-radius: 14px; padding: 16px; width: 100%; max-width: 410px; border: 1px solid #161b22; box-shadow: 0 15px 30px rgba(0,0,0,0.5); display: flex; flex-direction: column; max-height: 85vh; animation: popIn 0.25s ease-out; }
.modal-header-dark { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; border-bottom: 1px solid #21262d; padding-bottom: 8px; }
.modal-header-dark h3 { margin: 0; font-size: 14px; font-weight: 700; color: #fff; }
.close-btn-dark { color: #8b949e; cursor: pointer; font-size: 24px; line-height: 1; transition: 0.2s; }
.close-btn-dark:hover { color: #fff; }

.modal-body-scrollable { overflow-y: auto; max-height: 50vh; padding-right: 4px; }
/* Custom Scrollbar untuk Modal List */
.modal-body-scrollable::-webkit-scrollbar { width: 4px; }
.modal-body-scrollable::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }

@keyframes popIn { 0% { transform: scale(0.92); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Box Ringkasan Transaksi / Invoice */
.invoice-box { background-color: #161b22; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #30363d; font-size: 12.5px; }
.invoice-row-item { display: flex; justify-content: space-between; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px dashed #21262d; }
.invoice-row-item:last-child { border-bottom: none; margin-bottom: 0; }

/* Upload Zone */
.upload-dropzone { border: 2px dashed #30363d; border-radius: 8px; padding: 12px 6px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; transition: 0.2s; }
.upload-dropzone:hover { border-color: #2ea043; background: rgba(46,160,67,0.04); }
.btn-remove-bukti { position: absolute; top: 4px; right: 4px; background: rgba(248,81,73,0.9); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 10px; }
.pay-submit-btn { width: 100%; background-color: #2ea043; color: #fff; border: none; padding: 11px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13.5px; margin-top: 5px; transition: 0.2s; }
.pay-submit-btn:hover { background-color: #3fb950; }

/* Elemen List Keranjang & Riwayat */
.cart-item-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 10px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.cart-item-details h4 { font-size: 0.85rem; color: #fff; margin-bottom: 2px; }
.cart-item-details p { font-size: 0.72rem; color: #8b949e; }
.cart-item-remove-btn { background: none; border: none; color: #f85149; cursor: pointer; font-size: 1rem; padding: 4px; }

.cart-summary-box { border-top: 1px solid #30363d; padding-top: 12px; margin-top: 8px; }
.checkout-btn { width: 100%; background: #2ea043; color: white; border: none; padding: 10px; border-radius: 8px; font-weight: bold; font-size: 0.9rem; cursor: pointer; }

.riwayat-card { background: #161b22; border-left: 4px solid #2ea043; border-top: 1px solid #30363d; border-right: 1px solid #30363d; border-bottom: 1px solid #30363d; border-radius: 4px 8px 8px 4px; padding: 10px; margin-bottom: 8px; font-size: 0.78rem; }
.riwayat-date { color: #8b949e; font-size: 0.68rem; margin-bottom: 4px; text-align: right; }

/* Status Username Checker */
#username-status { margin-top: 6px; font-size: 0.8rem; min-height: 20px; }
.status-loading { color: #888; display: flex; align-items: center; gap: 6px; }
.status-valid { display: flex; align-items: center; gap: 8px; background: #e8f5e9; border: 1px solid #4CAF50; border-radius: 6px; padding: 6px 10px; }
.roblox-avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--leaf-primary); object-fit: cover; }
.status-info { display: flex; flex-direction: column; }
.status-name { font-weight: 700; color: var(--leaf-dark); font-size: 0.82rem; }
.status-id { color: #666; font-size: 0.7rem; }
.status-invalid { color: #c62828; display: flex; align-items: center; gap: 6px; background: #ffebee; border: 1px solid #ef9a9a; border-radius: 6px; padding: 6px 10px; font-weight: 600; }
.status-error { color: #e65100; display: flex; align-items: center; gap: 6px; background: #fff3e0; border: 1px solid #ffcc80; border-radius: 6px; padding: 6px 10px; }
