/* Define Default CSS Variable Tokens */
:root {
  --primary-color: #d6001c; /* Vibrant Red default from screenshot */
  --secondary-color: #7c3aed; /* Kaspro Purple */
  --bg-color: #f6f8fa; /* Soft grey background */
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-color: #10b981; /* Emerald 500 */
  --danger-color: #ef4444; /* Red 500 */
  --warning-color: #f59e0b; /* Amber 500 */
  --app-max-width: 480px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #cbd5e1; /* Grey background for desktop frame environment */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: var(--text-main);
}

/* Mobile App shell simulator for desktop */
.app-container {
  width: 100%;
  max-width: var(--app-max-width);
  height: 100vh;
  min-height: 560px;
  background: var(--bg-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible; /* Jangan potong kartu balance yang overlap header */
  clip-path: none;
}

@media (min-width: 481px) {
  .app-container {
    height: 90vh;
    border-radius: 36px;
    border: 10px solid #1e293b;
    overflow: hidden; /* Pada desktop frame, tetap clip untuk tampilan rapi */
  }
}

/* App Curved Header Section */
.app-header-curved {
  background: var(--primary-color);
  height: 120px;
  padding: 20px 20px 0 20px;
  color: white;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  transition: background-color 0.3s;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-name-white {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-icon-actions {
  display: flex;
  gap: 14px;
}

.header-action-icon-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.2s;
}

.header-action-icon-btn:hover {
  opacity: 0.8;
}

.header-login-container {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.header-btn-white {
  background: white;
  color: var(--primary-color);
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.header-btn-white:active {
  transform: scale(0.95);
}

/* Floating Balance Wallet Card */
.balance-floating-card {
  background: white;
  border-radius: 20px;
  padding: 14px 16px;
  margin: -32px 14px 0 14px; /* overlap ke header */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 30;           /* Di atas header (z-index 10) */
  position: relative;    /* Aktifkan z-index */
  flex-shrink: 0;        /* Jangan dikecilkan oleh flex parent */
}

.balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.balance-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--primary-color);
  background: rgba(225, 29, 72, 0.08);
}

.kaspro-logo-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #7c3aed; /* Kaspro Purple */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  padding: 2px;
  box-shadow: 0 4px 6px rgba(124, 58, 237, 0.2);
}

.kaspro-k {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
}
.kaspro-p {
  font-size: 0.5rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1;
}

.balance-text-info {
  display: flex;
  flex-direction: column;
}

.balance-lbl-grey {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.balance-amt-red {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.balance-amt-black {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.btn-topup-red {
  background: var(--primary-color);
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(225, 29, 72, 0.15);
  transition: transform 0.2s;
}

.btn-detail-purple {
  background: #7c3aed;
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(124, 58, 237, 0.15);
  transition: transform 0.2s;
}

.btn-topup-red:active, .btn-detail-purple:active {
  transform: scale(0.95);
}

.balance-divider {
  height: 1px;
  background: #f1f5f9;
}

/* App Scroll Content Wrapper */
.app-content-ppob {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 80px;
}

.app-content-ppob::-webkit-scrollbar {
  display: none;
}

/* Screen Shell */
.app-screen {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.app-screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quick Action Menu underneath wallet card */
.quick-action-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 4px 20px 16px 20px;
}

.quick-action-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #334155;
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: transform 0.2s;
}

.quick-action-item:active .quick-action-icon {
  transform: scale(0.9);
}

.quick-action-item span {
  font-size: 0.65rem;
  font-weight: 500;
  color: #475569;
}

/* Running Text Banner Ticker */
.running-text-banner {
  background: var(--primary-color);
  color: white;
  font-size: 0.68rem;
  padding: 6px 14px;
  font-weight: 500;
  overflow: hidden;
  margin-bottom: 16px;
}

.ticker-marquee {
  display: block;
}

/* Promo Banner Slider Carousel */
.banner-carousel-container {
  padding: 0 16px;
  margin-bottom: 20px;
}

.banner-carousel-inner {
  display: flex;
  gap: 12px;
}

.carousel-slide {
  flex: 1;
}

.main-promo-banner-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  border-radius: 16px;
  padding: 18px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 12px rgba(234, 88, 12, 0.15);
}

.orange-banner-tag {
  font-size: 0.55rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.orange-banner-left h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 4px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.orange-banner-left p {
  font-size: 0.72rem;
  opacity: 0.95;
  margin-top: 2px;
}

.orange-banner-badge {
  display: inline-block;
  background: #22c55e; /* Bright Green */
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 8px;
}

.shoppers-graphic {
  font-size: 2.5rem;
  opacity: 0.85;
}

.hidden-mobile {
  display: none; /* keep side slides hidden in mobile shell */
}

/* Services Grid Section */
.services-section {
  padding: 0 16px;
  margin-bottom: 24px;
}

.services-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.services-sec-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.services-link-red {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.services-sec-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
  margin-bottom: 12px;
}

/* 8 Grid icons */
.grid-8-services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.service-box-card {
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 16px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: transform 0.2s, border-color 0.2s;
}

.service-box-card:active {
  transform: scale(0.95);
  border-color: var(--primary-color);
}

.service-icon-outline {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.outline-pink { border: 1.5px solid #ec4899; color: #db2777; background: rgba(236,72,153,0.03); }
.outline-orange { border: 1.5px solid #f97316; color: #ea580c; background: rgba(249,115,22,0.03); }
.outline-red { border: 1.5px solid var(--primary-color); color: var(--primary-color); background: rgba(225,29,72,0.03); }
.outline-grey { border: 1.5px solid #94a3b8; color: #64748b; background: rgba(148,163,184,0.03); }

.service-card-lbl {
  font-size: 0.65rem;
  font-weight: 500;
  color: #475569;
  text-align: center;
}

/* Titles */
.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  padding: 0 16px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  padding: 0 16px;
}

/* Transaction Cards Lists */
.recent-tx-list, .full-tx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.tx-empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.75rem;
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px dashed rgba(226, 232, 240, 1);
}

.tx-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-left: 4px solid var(--text-muted);
}

.tx-card.status-success { border-left-color: var(--accent-color); }
.tx-card.status-pending { border-left-color: var(--warning-color); }
.tx-card.status-failed { border-left-color: var(--danger-color); }

.tx-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx-product {
  font-size: 0.82rem;
  font-weight: 600;
}

.tx-phone {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tx-sn-box {
  margin-top: 4px;
  font-family: monospace;
  font-size: 0.68rem;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  color: #334155;
  word-break: break-all;
}

.tx-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.tx-price {
  font-size: 0.82rem;
  font-weight: 700;
}

.tx-status-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.08); color: var(--accent-color); }
.badge-pending { background: rgba(245, 158, 11, 0.08); color: var(--warning-color); }
.badge-failed { background: rgba(239, 68, 68, 0.08); color: var(--danger-color); }

/* Deposit Screen Components */
.deposit-card, .profile-card, .support-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  margin: 0 16px 20px 16px;
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--primary-color);
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.pay-method-option {
  position: relative;
  cursor: pointer;
}

.pay-method-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pay-label {
  display: block;
  text-align: center;
  padding: 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.pay-method-option input:checked + .pay-label {
  border-color: var(--primary-color);
  background: rgba(225, 29, 72, 0.03);
  color: var(--primary-color);
}

.btn-submit-deposit, .btn-modal-submit, .btn-buy-now {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.2);
  transition: opacity 0.2s, transform 0.2s;
}

.btn-submit-deposit:active, .btn-modal-submit:active, .btn-buy-now:active {
  transform: scale(0.98);
}

.dep-history-list {
  padding: 0 16px;
}

.dep-ticket {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.dep-info {
  display: flex;
  flex-direction: column;
}

.dep-method {
  font-size: 0.8rem;
  font-weight: 600;
}

.dep-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Profile details */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.profile-detail:last-child {
  border: none;
  padding-bottom: 0;
}

.profile-detail span:first-child {
  color: var(--text-muted);
}

.profile-detail span:last-child {
  font-weight: 600;
}

.support-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.support-card p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.btn-whatsapp {
  display: block;
  text-align: center;
  background: #25d366;
  color: white;
  text-decoration: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(37, 211, 102, 0.15);
}

.btn-logout {
  background: none;
  border: 1.5px solid var(--danger-color);
  color: var(--danger-color);
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin: 0 16px;
}

/* Nav Bar fixed at bottom */
.app-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  height: 64px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(226, 232, 240, 1);
  padding: 0 10px;
  z-index: 10;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 500;
  gap: 4px;
  flex: 1;
  padding: 8px 0;
  transition: color 0.2s;
}

.nav-item.active {
  color: var(--primary-color); /* Red as active indicator in screenshot */
}

.nav-item svg {
  transition: transform 0.2s;
}

.nav-item.active svg {
  transform: translateY(-2px);
}

/* Modals Drawer style overlay */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  transition: opacity 0.3s;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  background: var(--card-bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85%;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h4 {
  font-size: 1rem;
  font-weight: 600;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-switch-text {
  font-size: 0.75rem;
  text-align: center;
  margin-top: 14px;
  color: var(--text-muted);
}

.modal-switch-text a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

/* Product list selectors inside modal */
.provider-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(225, 29, 72, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
}

.ppob-product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}

.loading-products, .empty-products {
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  padding: 20px 0;
}

.product-row-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.product-row-option:hover {
  background: #f8fafc;
}

.product-row-option.selected {
  border-color: var(--accent-color);
  background: rgba(16, 185, 129, 0.04);
}

.prod-details {
  display: flex;
  flex-direction: column;
}

.prod-name {
  font-size: 0.78rem;
  font-weight: 500;
}

.prod-code {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.prod-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-color);
}

.purchase-summary-box {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.3s;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.summary-line.total {
  font-size: 0.88rem;
  font-weight: 700;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  margin-top: 4px;
}

.btn-buy-now {
  background: var(--accent-color);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  margin-top: 10px;
}

.hidden {
  display: none !important;
}
