@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800;900&family=Noto+Sans+Sinhala:wght@500;600;700;800&display=swap');

:root {
  /* Default Clean Light Theme (Sri Lanka Fintech/Utility Style) */
  --bg: #f4f5f7;
  --card: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #334155;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --accent-gold: #f59e0b;
  --badge-bg: #eff6ff;
  --badge-border: #bfdbfe;
  
  --max-w: 28rem;
  --radius-lg: 1.25rem;
  --radius-md: 0.85rem;
  --radius-sm: 0.5rem;
}

/* Theme 1: DataLanka Pay (Dialog SL Orange/Red - Iconic Telecom) */
body.theme-databoost {
  --bg: #fff7ed;
  --card: #ffffff;
  --card-border: #ffedd5;
  --text-main: #431407;
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #fff7ed;
  --badge-bg: #fff7ed;
  --badge-border: #fed7aa;
}

/* Theme 2: LankaCash Rewards (LankaPay / Genie SL Deep Indigo) */
body.theme-cashback {
  --bg: #f5f3ff;
  --card: #ffffff;
  --card-border: #ddd6fe;
  --text-main: #1e1b4b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --badge-bg: #eef2ff;
  --badge-border: #c7d2fe;
}

/* Theme 3: LankaCart Rewards (Keells SL Deep Supermarket Green) */
body.theme-shopback {
  --bg: #f0fdf4;
  --card: #ffffff;
  --card-border: #bbf7d0;
  --text-main: #064e3b;
  --primary: #15803d;
  --primary-hover: #166534;
  --primary-light: #f0fdf4;
  --badge-bg: #f0fdf4;
  --badge-border: #bbf7d0;
}

/* Theme 4: LankaFuel Pay (PickMe SL Fuel Gold/Amber) */
body.theme-fueldata {
  --bg: #fffbeb;
  --card: #ffffff;
  --card-border: #fde68a;
  --text-main: #451a03;
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-light: #fffbeb;
  --badge-bg: #fffbeb;
  --badge-border: #fde68a;
}

/* Theme 5: PayBills Lanka (ComBank / SL Bank Royal Blue) */
body.theme-billbonus {
  --bg: #eff6ff;
  --card: #ffffff;
  --card-border: #bfdbfe;
  --text-main: #1e3a8a;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --badge-bg: #eff6ff;
  --badge-border: #bfdbfe;
}

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

html, body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', 'Noto Sans Sinhala', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

body {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Responsive Container */
.app-container {
  width: 100%;
  max-width: var(--max-w);
  padding: 0.75rem 0.75rem 1.2rem 0.75rem;
}

/* Header Lang Switcher & Urgency Bar */
.top-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.urgency-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.lang-toggle {
  display: inline-flex;
  background: #e2e8f0;
  padding: 0.15rem;
  border-radius: 999px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Compact Store Header Card */
.store-header {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.app-identity {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

/* Modern App Store Icon Styles */
.app-icon {
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.app-icon::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 100%);
  border-radius: 1rem 1rem 0 0;
  pointer-events: none;
}

.app-icon svg {
  width: 2rem;
  height: 2rem;
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
  z-index: 1;
}

.icon-databoost { background: linear-gradient(140deg, #fdba74 0%, #f97316 50%, #ea580c 100%); }
.icon-cashback { background: linear-gradient(140deg, #818cf8 0%, #4f46e5 50%, #4338ca 100%); }
.icon-shopback { background: linear-gradient(140deg, #4ade80 0%, #15803d 50%, #166534 100%); }
.icon-fueldata { background: linear-gradient(140deg, #fbbf24 0%, #d97706 50%, #b45309 100%); }
.icon-billbonus { background: linear-gradient(140deg, #60a5fa 0%, #1d4ed8 50%, #1e40af 100%); }

.app-titles {
  flex: 1;
  min-width: 0;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.15;
}

.app-developer {
  font-size: 0.74rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 900;
}

.app-category {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
  font-weight: 500;
}

/* Store Metrics Row */
.store-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.metric-star {
  color: var(--accent-gold);
  font-size: 0.75rem;
}

.metric-lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.05rem;
}

/* Main Reward Card / Highlight Pass - Big Bold Hero Ticket */
.reward-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl, 1rem);
  padding: 1.25rem 1.1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08), 0 2px 8px -2px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.reward-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 140px;
  height: 140px;
  background: var(--primary);
  opacity: 0.08;
  border-radius: 50%;
  pointer-events: none;
}

.reward-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: #ffffff;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.reward-amount {
  font-size: clamp(2.2rem, 9vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.05;
  margin-bottom: 0.45rem;
}

.reward-amount span {
  color: var(--primary);
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.reward-desc {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 0.75rem;
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
}

/* Operators / Badges */
.operators-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--card-border);
}

.operator-chip {
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--text-sub);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
}

/* APK Safety Badge - Authentic Google Play Protect */
.apk-trust-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #14532d;
}

.apk-trust-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.apk-trust-item.play-protect-item {
  color: #0f9d58;
  font-weight: 800;
}

.apk-trust-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.play-protect-shield {
  fill: #0f9d58;
  color: #ffffff;
}

/* Clean & Vibrant Step-by-Step + Reviews Section */
.info-section {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-xl, 1rem);
  padding: 0.95rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.section-head {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.4rem;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.step-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: var(--primary-light);
  border: 1px solid var(--badge-border);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  transition: transform 0.15s ease;
}

.step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.step-text strong {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.25;
}

/* Reviews Grid - Modern Store Review Cards */
.reviews-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.review-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.review-stars {
  color: #f59e0b;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.review-time {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

.review-quote {
  font-size: 0.82rem;
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.review-author-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.review-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.review-author .check {
  color: #16a34a;
  font-weight: 800;
  font-size: 0.7rem;
  margin-left: 0.2rem;
  background: #dcfce7;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
}

/* Non-blocking Floating Compact Social Toast */
.social-proof-toast {
  position: fixed;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  z-index: 99;
  transform: translateY(-150%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}

.social-proof-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer note */
.legal-footer {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  padding: 0.2rem 0.5rem 0.4rem;
}

/* Sticky Bottom Dock CTA with Shimmer Effect */
.bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  justify-content: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}

.dock-content {
  width: 100%;
  max-width: var(--max-w);
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3.3rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  border-radius: 0.85rem;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 6px 20px -2px rgba(0,0,0,0.18), 0 2px 6px -1px rgba(0,0,0,0.1);
  transition: transform 0.15s ease, background 0.15s ease;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 2.8s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  30% { left: 120%; }
  100% { left: 120%; }
}

.cta-button:active {
  transform: scale(0.98);
  background: var(--primary-hover);
}

.cta-button svg {
  width: 1.2rem;
  height: 1.2rem;
}

.cta-subtext {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 600;
}

/* RESPONSIVE BREAKPOINTS FOR ALL MOBILE SIZES */

/* Extra Small Phones (320px - 360px) */
@media (max-width: 360px) {
  .app-container {
    padding: 0.5rem 0.5rem 1rem 0.5rem;
  }
  .app-icon {
    width: 3.2rem;
    height: 3.2rem;
  }
  .app-title {
    font-size: 1.05rem;
  }
  .reward-card {
    padding: 0.85rem;
  }
  .reward-amount {
    font-size: 1.75rem;
  }
  .reward-desc {
    font-size: 0.76rem;
  }
  .cta-button {
    height: 2.9rem;
    font-size: 0.88rem;
  }
}

/* Tablet & Large Screen Viewport Bounds */
@media (min-width: 480px) {
  body {
    background-color: #e2e8f0;
  }
  .app-container {
    background-color: var(--bg);
    min-height: 100vh;
    box-shadow: 0 0 24px rgba(0,0,0,0.08);
  }
}
