/**
 * Bisapay Mobile-App Shell CSS
 * Pixel-perfect WeKios architecture: Centered 480px container on desktop, 100vw on mobile.
 */

:root {
  --primary: #125672;
  --primary-dark: #0d3e52;
  --primary-light: #e6f1f5;
  --primary-hover: #16698b;
  --bg-desktop: #d9e0e7;
  --bg-app: #f0f4f8;
  --surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-card: 14px;
  --radius-pill: 50px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body.app-mode {
  font-family: var(--font-family);
  background-color: var(--bg-desktop);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* 480px Centered Smartphone Frame */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-app);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.14);
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 70px; /* Space for bottom nav */
}

@media (max-width: 480px) {
  body.app-mode {
    background-color: var(--bg-app);
  }
  .app-container {
    box-shadow: none;
    max-width: 100%;
  }
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-top-header {
  background-color: var(--primary);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(18, 86, 114, 0.2);
}

.app-top-header .header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.app-top-header .header-left iconify-icon {
  font-size: 20px;
  color: #fde047;
}

.app-top-header .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-top-header .header-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  text-decoration: none;
}

.app-top-header .header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.app-top-header .header-btn .badge-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
}

/* Standard Header for subpages (Transaksi, Mitra, Info) */
.page-header-standard {
  background-color: var(--primary);
  color: #ffffff;
  padding: 18px 16px 14px;
}

.page-header-standard h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -0.3px;
}

.page-header-standard p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

/* ==========================================================================
   TAB PANELS (SPA ROUTING)
   ========================================================================== */
.app-tab-panel {
  display: none;
  animation: tabFadeIn 0.2s ease-in-out;
}

.app-tab-panel.active {
  display: block;
}

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

/* ==========================================================================
   PROMO CAROUSEL & CHIP PACKETS (HOME)
   ========================================================================== */
.home-promo-wrapper {
  padding: 12px 14px 4px;
}

.promo-banner-card {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  background: linear-gradient(135deg, #125672, #0d729c);
  color: #fff;
  min-height: 125px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.promo-banner-card .banner-info {
  max-width: 65%;
}

.promo-banner-card .banner-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: #fde047;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.promo-banner-card h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.promo-banner-card p {
  font-size: 11px;
  opacity: 0.9;
  line-height: 1.3;
}

.promo-banner-card .banner-cta {
  background: #fde047;
  color: #125672;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  margin-top: 8px;
}

/* Paket Nasional Card */
.paket-nasional-card {
  background: var(--surface);
  margin: 10px 14px;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.paket-nasional-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.paket-nasional-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.paket-nasional-header h4::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.btn-atur-menu {
  background: #f1f5f9;
  color: var(--primary);
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
}

.paket-operators-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 4px;
}

.operator-chip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-main);
}

.operator-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.operator-chip-item span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   BEST SELLER 4-COLUMN SERVICE GRID
   ========================================================================== */
.service-section-card {
  background: var(--surface);
  margin: 10px 14px 16px;
  padding: 14px 12px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.service-section-header {
  margin-bottom: 12px;
  padding-left: 2px;
}

.service-section-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.service-section-header h4::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.service-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
}

.service-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.service-grid-item:active {
  transform: scale(0.94);
}

.service-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f0f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 22px;
  transition: all 0.2s;
  border: 1px solid #e1eff5;
}

.service-grid-item:hover .service-icon-box {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.service-grid-item .service-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 90px;
}

/* ==========================================================================
   TRANSAKSI TAB (HISTORY)
   ========================================================================== */
.filter-tabs-wrapper {
  background: var(--primary);
  padding: 0 14px 14px;
}

.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-pills-row::-webkit-scrollbar {
  display: none;
}

.filter-pill-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.history-content-wrapper {
  padding: 20px 14px;
}

.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-box iconify-icon {
  font-size: 56px;
  color: #94a3b8;
  margin-bottom: 14px;
}

.empty-state-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-state-box p {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 240px;
}

/* Transaction Card Item */
.trx-card-item {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.trx-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.trx-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.trx-card-badge.sukses {
  background: #dcfce7;
  color: #15803d;
}

.trx-card-badge.proses {
  background: #fef9c3;
  color: #a16207;
}

.trx-card-badge.gagal {
  background: #fee2e2;
  color: #b91c1c;
}

.trx-card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.trx-card-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 13.5px;
}

/* ==========================================================================
   MITRA TAB (PARTNERSHIP)
   ========================================================================== */
.mitra-stat-strip {
  background: var(--surface);
  margin: -10px 14px 12px;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px 6px;
  position: relative;
  z-index: 10;
  border: 1px solid #f1f5f9;
}

.mitra-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid #f1f5f9;
}

.mitra-stat-item:last-child {
  border-right: none;
}

.mitra-stat-item .stat-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.mitra-stat-item .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   INFORMASI TAB (FEED & BROADCAST)
   ========================================================================== */
.info-feed-wrapper {
  padding: 12px 14px;
}

.info-card-item {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.info-avatar-box {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.info-header-meta h5 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.info-header-meta span {
  font-size: 10.5px;
  color: var(--text-subtle);
}

.info-card-body h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.info-card-body p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-line;
}

.info-card-reactions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.reaction-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

/* ==========================================================================
   AKUN TAB (PROFILE)
   ========================================================================== */
.akun-curved-header {
  background: var(--primary);
  color: #ffffff;
  padding: 24px 16px 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  position: relative;
}

.akun-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.akun-info-meta {
  flex: 1;
}

.akun-info-meta h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.2px;
}

.akun-info-meta p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

.akun-action-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.akun-action-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
}

/* List Groups (Aktivitas & Pengaturan) */
.profile-menu-section {
  padding: 0 14px 12px;
}

.profile-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
  margin: 14px 4px 8px;
}

.profile-list-group {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.profile-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid #f8fafc;
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.15s;
}

.profile-list-item:last-child {
  border-bottom: none;
}

.profile-list-item:active {
  background-color: #f1f5f9;
}

.profile-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f0f7fa;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.profile-item-text {
  display: flex;
  flex-direction: column;
}

.profile-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.profile-item-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-subtle);
  font-size: 16px;
}

.profile-badge-num {
  background: #e2e8f0;
  color: var(--text-main);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

/* ==========================================================================
   FIXED BOTTOM NAVIGATION BAR (5 MENUS)
   ========================================================================== */
.app-bottom-navbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 60px;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  width: 20%;
  height: 100%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item-btn iconify-icon {
  font-size: 20px;
  transition: transform 0.15s ease;
}

.nav-item-btn span {
  font-size: 10px;
  font-weight: 600;
}

.nav-item-btn.active {
  color: var(--primary);
}

.nav-item-btn.active iconify-icon {
  transform: scale(1.12);
}

/* Floating Action Button for Live Chat */
.fab-live-chat {
  position: fixed;
  bottom: 74px;
  left: calc(50% - 225px);
  z-index: 990;
  background: #ffffff;
  border-radius: 50px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
}

@media (max-width: 480px) {
  .fab-live-chat {
    left: 14px;
  }
}

.fab-live-chat .chat-icon-circle {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
