/* ==========================
   WHAPAXX CUSTOMER UI SYSTEM
   whapaxx-ui.css
   - Global theme tokens
   - Layout & containers
   - Reusable components
   - Responsive tweaks
   ========================== */

/* ---------- CSS RESET / BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}
body {
  overflow-y: auto;
  overscroll-behavior-y: contain;   /* enables bounce without triggering page refresh */
  -webkit-overflow-scrolling: touch; /* iOS + Android spring effect */
}

/* Allow the body background to always show */
html,
body {
  min-height: 100vh;
}

/* System font stack + fallback */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: #eaf2ff;
  background: radial-gradient(circle at top, #161f6b 0, #05081f 50%, #020315 100%);
}

/* Remove default link styling */
a {
  color: inherit;
  text-decoration: none;
}

/* ---------- THEME TOKENS ---------- */
:root {
  --wpxg-bg: #05081f;
  --wpxg-bg-elevated: #0b1247;
  --wpxg-bg-elevated-soft: #101853;
  --wpxg-bg-soft: #141b4f;
  --wpxg-accent: #e52b39;
  --wpxg-accent-soft: rgba(229, 43, 57, 0.14);
  --wpxg-accent-strong: #ff4b5a;
  --wpxg-accent-glow: 0 0 18px rgba(229, 43, 57, 0.55);
  --wpxg-accent-soft-glow: 0 0 24px rgba(229, 43, 57, 0.35);
  --wpxg-teal: #12d0ff;
  --wpxg-teal-soft: rgba(18, 208, 255, 0.14);
  --wpxg-teal-glow: 0 0 20px rgba(18, 208, 255, 0.7);
  --wpxg-gold: #ffc857;
  --wpxg-text: #eaf2ff;
  --wpxg-text-soft: #a8b2ff;
  --wpxg-text-muted: #7881c0;
  --wpxg-border-subtle: rgba(255, 255, 255, 0.08);
  --wpxg-border-strong: rgba(255, 255, 255, 0.16);
  --wpxg-radius-lg: 18px;
  --wpxg-radius-xl: 24px;
  --wpxg-radius-pill: 999px;
  --wpxg-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.4);
  --wpxg-shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.45);
  --wpxg-shadow-halo: 0 0 48px rgba(18, 208, 255, 0.25);
  --wpxg-blur-strong: blur(20px);
  --wpxg-blur-soft: blur(12px);
}

/* ---------- GLOBAL BACKGROUND LAYER ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top left, rgba(18, 208, 255, 0.18), transparent 55%),
    radial-gradient(circle at top right, rgba(229, 43, 57, 0.18), transparent 55%),
    radial-gradient(circle at center, rgba(11, 18, 71, 0.85), #020315 70%);
  opacity: 0.92;
}

/* Subtle grid / scanline overlay (optional) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
      repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.03),
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 3px
      ),
      repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.4),
        rgba(0, 0, 0, 0.4) 1px,
        transparent 1px,
        transparent 4px
      );
}

/* ---------- APP SHELL LAYOUT ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Safe area handling for iOS top notch */
.app-shell-header {
  padding-top: env(safe-area-inset-top, 0);
}

/* Main scroll area */
/* Main scroll area */
.app-shell-main {
  flex: 1 1 auto;
  min-height: 0;                       /* critical for flex + scroll */
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ---------- GLASSY PANELS / CARDS ---------- */
.glass-panel {
  background: linear-gradient(
    135deg,
    rgba(11, 18, 71, 0.92),
    rgba(5, 8, 31, 0.98)
  );
  border-radius: var(--wpxg-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--wpxg-shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---------- GLOBAL BUTTON STYLES ---------- */
.btn {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #e52b39, #ff4b5a);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 16px 30px rgba(229, 43, 57, 0.55);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.btn span.btn-label {
  position: relative;
  z-index: 2;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at top,
    rgba(255, 255, 255, 0.32),
    transparent 55%
  );
  opacity: 0.55;
  z-index: 1;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(229, 43, 57, 0.6);
}

/* Subtle secondary button */
.btn-secondary {
  background: rgba(17, 25, 88, 0.9);
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.55);
}
.btn-secondary::before {
  background: radial-gradient(
    circle at top,
    rgba(255, 255, 255, 0.2),
    transparent 60%
  );
}

/* ---------- TAGS / LABEL CHIPS ---------- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(
    135deg,
    rgba(18, 208, 255, 0.18),
    rgba(11, 18, 71, 0.95)
  );
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
}

/* Status variants */
.tag-chip--success {
  border-color: rgba(0, 204, 153, 0.7);
  background: linear-gradient(
    135deg,
    rgba(0, 204, 153, 0.3),
    rgba(5, 8, 31, 0.98)
  );
}
.tag-chip--warning {
  border-color: rgba(255, 200, 87, 0.9);
  background: linear-gradient(
    135deg,
    rgba(255, 200, 87, 0.28),
    rgba(11, 18, 71, 0.96)
  );
}
.tag-chip--danger {
  border-color: rgba(229, 43, 57, 0.9);
  background: linear-gradient(
    135deg,
    rgba(229, 43, 57, 0.3),
    rgba(11, 18, 71, 0.96)
  );
}

/* ---------- CARDS LAYOUT ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(11, 18, 71, 0.92),
    rgba(2, 3, 21, 0.98)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--wpxg-shadow-sm);
  padding: 12px;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease,
    background 0.2s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at top left, rgba(18, 208, 255, 0.08), transparent 55%),
    radial-gradient(circle at bottom right, rgba(229, 43, 57, 0.1), transparent 55%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.card:hover::before {
  opacity: 1;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.7),
    0 0 22px rgba(18, 208, 255, 0.25);
  border-color: rgba(18, 208, 255, 0.35);
}

/* ---------- TEXT UTILITIES ---------- */
.text-soft {
  color: var(--wpxg-text-soft);
}
.text-muted {
  color: var(--wpxg-text-muted);
}
.text-accent {
  color: var(--wpxg-accent-strong);
}
.text-teal {
  color: var(--wpxg-teal);
}

/* ---------- SURFACE BACKGROUNDS ---------- */
.surface-soft {
  background: radial-gradient(
      circle at top left,
      rgba(18, 208, 255, 0.16),
      transparent 60%
    ),
    linear-gradient(145deg, rgba(11, 18, 71, 0.98), rgba(5, 8, 31, 0.98));
  border-radius: var(--wpxg-radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--wpxg-shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---------- EDGE GESTURE HINT (if you use it) ---------- */
.edge-hint {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.edge-hint::before,
.edge-hint::after {
  display: none !important;
}

/* --- Android Safe Area for Bottom Gesture Bar (Global) --- */
@supports (padding: env(safe-area-inset-bottom)) {
  /* Only fixed-bottom elements get lifted; no global body padding */
  .safe-bottom,
  [data-safe-bottom] {
    margin-bottom: calc(env(safe-area-inset-bottom) + 12px);
  }
}
/* Reusable springy scroll container for panels/sheets/lists */
.springy-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  flex: 1 1 auto;
  min-height: 0;
}
/* Disable long-press actions on iOS */
* {
  -webkit-touch-callout: none !important;   /* disables copy/save/share menu */
  -webkit-user-select: none !important;     /* prevents text selection */
  user-select: none !important;
}

img, svg {
  pointer-events: none; /* prevents long-press save/share on images */
}
img {
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
}
/* iOS safe area fix: extend background + remove black bar */
/* iOS: just ensure a solid base behind gradients */
html, body {
  background-color: #070d26 !important;
  /* no padding-bottom here */
}