/* ============================================================
   DataPro — Design System CSS
   ============================================================ */

/* ─── Google Font import ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─── Alpine.js — hide x-cloak elements until Alpine initialises ── */
[x-cloak] { display: none !important; }

/* ─── Auth page — register form hidden by default; Alpine toggles it ── */
#register-form { display: none; }

/* ─── Page entry transition ──────────────────────────────── */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.5; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

/* Page wrapper animation — every page fades in smoothly */
.page-wrapper {
  animation: pageEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-fade-in   { animation: fadeIn 0.25s ease forwards; }
.animate-slide-up  { animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.animate-scale-in  { animation: scaleIn 0.2s ease forwards; }
.animate-spin      { animation: spin 1s linear infinite; }
.pulse-green       { animation: pulse-dot 1.8s ease-in-out infinite; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.35); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.25); }
  70%       { transform: scale(1); }
}
.pulse-heart        { animation: heartbeat 1.4s ease-in-out infinite; }
.pulse-heart-slow   { animation: heartbeat 2.2s ease-in-out infinite; }
.pulse-heart-fast   { animation: heartbeat 0.8s ease-in-out infinite; }

/* Staggered card entry */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ─── Global base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Prevent iOS Safari from zooming on input focus (requires font-size ≥ 16px) */
@supports (-webkit-touch-callout: none) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #F5A623;
  border-radius: 2px;
}

/* ─── Gold gradient card ─────────────────────────────────── */
.gold-card {
  background: linear-gradient(135deg, #F5A623 0%, #d4880e 100%);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.gold-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.gold-card::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -10px;
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
}

/* ─── Cards ──────────────────────────────────────────────── */
.dp-card {
  border-radius: 16px;
  padding: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.dark .dp-card {
  background: #242438;
  border: 1px solid rgba(255,255,255,0.04);
}
html:not(.dark) .dp-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.dp-card:hover {
  transform: translateY(-1px);
}
.dark .dp-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
html:not(.dark) .dp-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* ─── Network badges ─────────────────────────────────────── */
.badge-mtn      { background: #FFCC00; color: #111; font-weight: 800; }
.badge-telecel  { background: #E60000; color: #fff; font-weight: 800; }
.badge-at       { background: #0072C6; color: #fff; font-weight: 800; }

/* ─── Status pills ───────────────────────────────────────── */
.status-pending    { background: rgba(245,166,35,0.12); color: #F5A623; }
.status-processing { background: rgba(59,130,246,0.12); color: #60A5FA; }
.status-accepted   { background: rgba(107,114,128,0.12); color: #9CA3AF; }
.status-completed  { background: rgba(34,197,94,0.12);   color: #22C55E; }
.status-delivered  { background: rgba(34,197,94,0.12);   color: #22C55E; }
.status-failed     { background: rgba(239,68,68,0.12);   color: #EF4444; }
.status-cancelled  { background: rgba(107,114,128,0.12); color: #9CA3AF; }
.status-disputed   { background: rgba(168,85,247,0.12);  color: #A855F7; }
.status-refunded   { background: rgba(34,197,94,0.12);   color: #22C55E; }

/* ─── Delay banner ───────────────────────────────────────── */
.delay-banner {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 14px;
  padding: 14px 16px;
}

/* ─── Bundle cards ───────────────────────────────────────── */
.bundle-card {
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  border: 2px solid transparent;
  user-select: none;
}
.dark .bundle-card {
  background: #242438;
  border-color: rgba(255,255,255,0.04);
}
html:not(.dark) .bundle-card {
  background: #ffffff;
  border-color: #f0f0f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.bundle-card:hover {
  border-color: rgba(245,166,35,0.5);
  transform: translateY(-3px);
}
.dark .bundle-card:hover   { box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
html:not(.dark) .bundle-card:hover { box-shadow: 0 8px 20px rgba(245,166,35,0.15); }
.bundle-card:active        { transform: translateY(-1px) scale(0.99); }
.bundle-card.selected {
  border-color: #F5A623;
  background: rgba(245,166,35,0.07);
  transform: translateY(-2px);
}

/* ─── Inputs ─────────────────────────────────────────────── */
.dp-input {
  width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px; /* ≥16px prevents iOS auto-zoom on focus */
  font-family: inherit;
  outline: none;
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dark .dp-input {
  background: #2E2E45;
  color: #ffffff;
  border-color: rgba(255,255,255,0.08);
}
html:not(.dark) .dp-input {
  background: #f5f5f5;
  color: #111111;
  border-color: #e5e7eb;
}
.dp-input:focus {
  border-color: #F5A623;
  box-shadow: 0 0 0 3px rgba(245,166,35,0.12);
}
.dp-input::placeholder { color: #6B7280; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background: #F5A623;
  color: #111111;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  border-radius: 50px;
  padding: 14px 24px;
  width: 100%;
  border: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.15s ease;
}
.btn-primary:hover::after   { background: rgba(0,0,0,0.06); }
.btn-primary:active         { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ─── Tab pills ──────────────────────────────────────────── */
.tab-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.tab-scroll::-webkit-scrollbar { display: none; }

.tab-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  border: none;
}
.dark .tab-pill {
  background: #2E2E45;
  color: #9CA3AF;
}
html:not(.dark) .tab-pill {
  background: #f0f0f0;
  color: #6B7280;
}
.tab-pill.active {
  background: #F5A623;
  color: #111111;
}
.tab-pill:not(.active):hover {
  opacity: 0.8;
}

/* ─── Payment option selector ────────────────────────────── */
.payment-option {
  border-radius: 14px;
  padding: 14px 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dark .payment-option           { background: #2E2E45; }
html:not(.dark) .payment-option { background: #f5f5f5; }
.payment-option.selected        { border-color: #F5A623; }
.payment-option:hover           { border-color: rgba(245,166,35,0.4); }

/* ─── Icon circle ────────────────────────────────────────── */
.icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

/* ─── Section header ─────────────────────────────────────── */
.page-header { padding: 20px 0 12px; }
.page-header h1 {
  font-size: 24px;
  font-weight: 800;
  border-left: 4px solid #F5A623;
  padding-left: 12px;
  line-height: 1.2;
}
.page-header p {
  font-size: 13px;
  color: #6B7280;
  padding-left: 16px;
  margin-top: 3px;
}

.section-header { border-left: 4px solid #F5A623; padding-left: 12px; }

/* ─── Verified badge ─────────────────────────────────────── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1.5px solid #22C55E;
  color: #22C55E;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Skeleton loaders ───────────────────────────────────── */
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #2E2E45 25%, #3a3a55 50%, #2E2E45 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}
html:not(.dark) .skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
}

/* ─── Progress bar ───────────────────────────────────────── */
.progress-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.dark .progress-bar            { background: #2E2E45; }
html:not(.dark) .progress-bar  { background: #e5e7eb; }
.progress-fill {
  height: 100%;
  background: #F5A623;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── Stats mini-card ────────────────────────────────────── */
.stat-card {
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  flex: 1;
  transition: transform 0.15s ease;
}
.dark .stat-card            { background: #2E2E45; }
html:not(.dark) .stat-card  { background: #f5f5f5; }
.stat-card:hover            { transform: translateY(-2px); }
.stat-card .stat-value      { font-size: 18px; font-weight: 800; line-height: 1.2; }
.stat-card .stat-label      {
  font-size: 10px;
  color: #6B7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* ─── WhatsApp float ─────────────────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 88px; /* sits just above the mobile bottom nav */
  right: 14px;
  z-index: 200; /* above page content, below modals */
  text-decoration: none;
}
@media (min-width: 1024px) {
  .whatsapp-float {
    bottom: 24px; /* no bottom nav on desktop */
  }
}

/* ─── Toast ──────────────────────────────────────────────── */
#toast-container > div {
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ============================================================
   BOTTOM NAVIGATION — expanding pill style
   ============================================================ */

/* Mobile header must always stretch full width */
.dp-topbar { left: 0; }

.dp-bottom-nav {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.dark .dp-bottom-nav {
  background: rgba(26, 26, 46, 0.97);
  border-top: 1px solid rgba(255,255,255,0.06);
}
html:not(.dark) .dp-bottom-nav {
  background: rgba(255,255,255,0.97);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 -1px 12px rgba(0,0,0,0.05);
}

/* Each tab — equal share, centered */
.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.nav-tab:active { transform: scale(0.88); }

/* Inner pill wraps icon + label */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 9px 12px;
  border-radius: 50px;
  overflow: hidden;
  transition:
    background  0.25s cubic-bezier(0.22, 1, 0.36, 1),
    padding     0.25s cubic-bezier(0.22, 1, 0.36, 1),
    gap         0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-pill svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}

/* Label — hidden on inactive, slides in on active */
.nav-label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition:
    max-width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.2s ease,
    color     0.2s ease;
}

/* ── Inactive state ── */
.nav-tab.inactive .nav-pill       { background: transparent; }
.nav-tab.inactive .nav-pill svg   { stroke: #9CA3AF; }
.nav-tab.inactive .nav-label      { max-width: 0; opacity: 0; }

/* ── Active state — pill expands to show label ── */
.nav-tab.active-tab .nav-pill {
  background: #F5A623;
  padding: 9px 18px;
  gap: 7px;
}
.nav-tab.active-tab .nav-pill svg  { stroke: #111111; }
.nav-tab.active-tab .nav-label {
  max-width: 90px;
  opacity: 1;
  color: #111111;
}

/* Hover on inactive */
.nav-tab.inactive:hover .nav-pill     { background: rgba(245,166,35,0.10); }
.nav-tab.inactive:hover .nav-pill svg { stroke: #F5A623; }

/* ============================================================
   DESKTOP SIDEBAR LAYOUT
   ============================================================ */
@media (min-width: 1024px) {

  /* Fixed left sidebar */
  .dp-sidebar {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
  }
  .dark .dp-sidebar {
    background: #1E1E30;
    border-right: 1px solid rgba(255,255,255,0.05);
  }
  html:not(.dark) .dp-sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.07);
    box-shadow: 2px 0 12px rgba(0,0,0,0.05);
  }

  /* Main content pushed right */
  .dp-main {
    margin-left: 260px;
    min-height: 100vh;
  }

  /* Top header on desktop starts after sidebar */
  .dp-topbar {
    left: 260px !important;
  }

  /* Main content top padding accounts for fixed topbar */
  .dp-content {
    padding-top: 72px;
  }

  /* Hide mobile bottom nav */
  .dp-bottom-nav { display: none !important; }
}

/* ─── Waving hand emoji ──────────────────────────────────────── */
@keyframes wave-hand {
  0%   { transform: rotate(  0deg); }
  10%  { transform: rotate(-10deg); }
  20%  { transform: rotate( 12deg); }
  30%  { transform: rotate(-10deg); }
  40%  { transform: rotate( 10deg); }
  50%  { transform: rotate(  0deg); }
  100% { transform: rotate(  0deg); }
}
.wave-hand {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave-hand 2.2s ease-in-out 0.6s 3;
}

/* Mobile — no sidebar */
@media (max-width: 1023px) {
  .dp-sidebar    { display: none !important; }
  .dp-main       { margin-left: 0; }
  .dp-content    { padding-top: 64px; padding-bottom: 80px; }
  .dp-bottom-nav { display: flex; }

  /* Compact welcome card on mobile so balance + status are visible above the fold */
  .gold-card.mobile-compact-card { padding: 12px 16px; }
}

/* Sidebar nav link */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  margin-bottom: 2px;
}
.dark .sidebar-link {
  color: #9CA3AF;
}
html:not(.dark) .sidebar-link {
  color: #6B7280;
}
.sidebar-link:hover {
  background: rgba(245,166,35,0.08);
  color: #F5A623;
}
.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: stroke 0.15s ease;
}
.sidebar-link.active-link {
  background: #F5A623;
  color: #111111;
}
.sidebar-link.active-link svg { stroke: #111111; }
.sidebar-link:not(.active-link):hover svg { stroke: #F5A623; }

/* ─── System notice (fixed bar above header) ─────────────── */
#sys-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  min-height: 48px;
}

/* Header offset when notice is present */
body.notice-active .dp-topbar { top: 48px !important; }

/* Content offset when notice is present */
@media (max-width: 1023px) {
  body.notice-active .dp-content { padding-top: 112px !important; }
}
@media (min-width: 1024px) {
  body.notice-active .dp-content { padding-top: 120px !important; }
}

/* ─── Verify-email banner — fixed top bar (40px tall) ────── */
#verify-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 65;   /* above header (z-60), below sys-notice (z-70) */
  height: 40px;
}

/* Header pushed down by verify banner alone */
body.verify-active .dp-topbar { top: 40px !important; }

/* Content offset: 40px banner + 64px header (mobile) / 72px (desktop) */
@media (max-width: 1023px) {
  body.verify-active .dp-content { padding-top: 104px !important; }
}
@media (min-width: 1024px) {
  body.verify-active .dp-content { padding-top: 112px !important; }
}

/* When sys-notice is also present, verify banner slides below it */
body.notice-active #verify-banner { top: 48px !important; }

/* Header pushed below both banners */
body.notice-active.verify-active .dp-topbar { top: 88px !important; }

/* Content offset: 48 + 40 + 64 mobile / + 72 desktop */
@media (max-width: 1023px) {
  body.notice-active.verify-active .dp-content { padding-top: 152px !important; }
}
@media (min-width: 1024px) {
  body.notice-active.verify-active .dp-content { padding-top: 160px !important; }
}

/* ─── Modal overlay — covers 100% of viewport, blurs everything ─ */
.dp-modal-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; /* explicit instead of inset shorthand */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* mobile: sheet at bottom */
  /* Darken + blur the full viewport */
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px) saturate(0.8);
  -webkit-backdrop-filter: blur(14px) saturate(0.8);
}

/* Tablet / desktop — centre the box vertically */
@media (min-width: 640px) {
  .dp-modal-overlay {
    justify-content: center;
    /* extra top space so modal clears the fixed header */
    padding-top: 72px;
    padding-bottom: 24px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ── Modal box ── */
.dp-modal-box {
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0; /* mobile: sheet shape */
  padding: 20px 20px 0;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  /* cap height — sheet never climbs past 60% of viewport height */
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .dp-modal-box {
    border-radius: 20px;
    padding: 28px 28px;
    max-height: 80vh;
    padding-bottom: 28px;
  }
}

.dark .dp-modal-box {
  background: #1C1C2E;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
}
html:not(.dark) .dp-modal-box {
  background: #ffffff;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.04);
}

/* ─── Page transition overlay ────────────────────────────── */
#page-transition {
  position: fixed;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.dark #page-transition.leaving {
  opacity: 1;
  background: rgba(26, 26, 46, 0.55);
  pointer-events: all;
}
html:not(.dark) #page-transition.leaving {
  opacity: 1;
  background: rgba(240, 240, 245, 0.6);
  pointer-events: all;
}
