/* =============================================
   LET'S TRADE — Design System
   Kelly Nice Exchange | Premium Fintech CSS
   ============================================= */

/* ---- Google Fonts ---- */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap");

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #161b22;
  --bg-hover: #1c2128;

  --orange-primary: #c96a19;
  --orange-accent: #ff8c32;
  --orange-light: #ffb067;
  --orange-glow: rgba(201, 106, 25, 0.2);

  --white: #ffffff;
  --text-primary: #f0f6fc;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --green: #16c784;
  --green-bg: rgba(22, 199, 132, 0.12);
  --red: #ea3943;
  --red-bg: rgba(234, 57, 67, 0.12);
  --blue: #3b82f6;
  --yellow: #f59e0b;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 140, 50, 0.3);

  /* Typography */
  --font-primary: "Poppins", sans-serif;
  --font-secondary: "Inter", sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-pill: 50px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-orange: 0 8px 32px rgba(201, 106, 25, 0.35);
  --shadow-glow: 0 0 40px rgba(201, 106, 25, 0.2);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Z-index scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-top: 999;

  /* Bottom nav height */
  --bottom-nav-h: 72px;
  --header-h: 64px;

  /* Orange border (used in settings cards) */
  --orange-border: rgba(201, 106, 25, 0.3);
}

/* ── Light Mode overrides ─────────────────────────────────── */
html.light-mode {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e4e7ec;
  --bg-card: #ffffff;
  --bg-hover: #f5f7fa;

  --text-primary: #0d1117;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(201, 106, 25, 0.4);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);
}

html.light-mode body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

html.light-mode .card,
html.light-mode .modal-card,
html.light-mode .bottom-sheet-card {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

html.light-mode .page-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

html.light-mode .bottom-nav {
  background: #ffffff;
  border-top: 1px solid var(--border);
}

html.light-mode .input-field {
  background: #f0f2f5;
  color: var(--text-primary);
  border-color: var(--border);
}

html.light-mode .text-secondary {
  color: var(--text-secondary);
}
html.light-mode .text-muted {
  color: var(--text-muted);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange-primary);
}

/* ---- Selection ---- */
::selection {
  background: var(--orange-glow);
  color: var(--orange-accent);
}

/* ---- Links ---- */
a {
  color: var(--orange-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--orange-light);
}

/* ---- Images ---- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- Utility: Hide/Show ---- */
.hidden {
  display: none !important;
}
.invisible {
  visibility: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---- Page Wrapper ---- */
.page-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-primary);
  overflow-x: hidden;
  overflow-y: auto;
}

/* ---- App Shell ---- */
#app {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

/* ---- Screens ---- */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg-primary);
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease;
}
.screen.active {
  display: flex !important;
  flex-direction: column !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  z-index: 10;
}

/* Splash is fixed so needs its own active rule */
#screen-splash {
  background: #0d1117;
  position: fixed !important;
  inset: 0;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#screen-splash.active {
  display: flex;
  position: fixed;
}
#screen-splash.splash-hidden {
  display: none !important;
}
.screen.slide-in-right {
  display: flex !important;
  flex-direction: column !important;
  animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.screen.slide-in-left {
  display: flex !important;
  flex-direction: column !important;
  animation: slideInLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.screen.fade-in {
  display: flex !important;
  flex-direction: column !important;
  animation: fadeInScreen 0.3s ease forwards;
}

/* ---- Typography ---- */
.text-xs {
  font-size: 11px;
}
.text-sm {
  font-size: 13px;
}
.text-base {
  font-size: 15px;
}
.text-md {
  font-size: 17px;
}
.text-lg {
  font-size: 20px;
}
.text-xl {
  font-size: 24px;
}
.text-2xl {
  font-size: 30px;
}
.text-3xl {
  font-size: 36px;
}

.font-light {
  font-weight: 300;
}
.font-regular {
  font-weight: 400;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}
.font-black {
  font-weight: 900;
}

.text-primary {
  color: var(--text-primary) !important;
}
.text-secondary {
  color: var(--text-secondary) !important;
}
.text-muted {
  color: var(--text-muted) !important;
}
.text-orange {
  color: var(--orange-accent) !important;
}
.text-green {
  color: var(--green) !important;
}
.text-red {
  color: var(--red) !important;
}
.text-white {
  color: #fff !important;
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: linear-gradient(
    135deg,
    var(--orange-primary),
    var(--orange-accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.card-sm {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
}
.card-xs {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
}

.card-glass {
  background: rgba(22, 27, 34, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
}

.card-orange {
  background: linear-gradient(
    135deg,
    var(--orange-primary),
    var(--orange-accent)
  );
  border: none;
}

.card:hover .card-hover-effect {
  opacity: 1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn:disabled:active {
  transform: none;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--orange-primary),
    var(--orange-accent)
  );
  color: #fff;
  box-shadow: var(--shadow-orange);
}
.btn-primary:hover {
  box-shadow: 0 12px 40px rgba(201, 106, 25, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--orange-accent);
  border: 2px solid var(--orange-primary);
}
.btn-outline:hover {
  background: var(--orange-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 10px 16px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.btn-danger {
  background: linear-gradient(135deg, #c0392b, var(--red));
  color: #fff;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 13px;
}
.btn-lg {
  padding: 17px 32px;
  font-size: 17px;
}
.btn-full {
  width: 100%;
}
.btn-icon {
  padding: 12px;
  border-radius: var(--radius-md);
  aspect-ratio: 1;
}

/* Ripple effect */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.25) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s;
}
.btn:active::after {
  opacity: 1;
}

/* ---- Inputs ---- */
.input-group {
  position: relative;
  margin-bottom: var(--space-md);
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  transition: color var(--transition-fast);
}

.input-field {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-family: var(--font-primary);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-normal);
  -webkit-appearance: none;
}

.input-field::placeholder {
  color: var(--text-muted);
}
.input-field:focus {
  border-color: var(--orange-primary);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--orange-glow);
}
.input-field.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(234, 57, 67, 0.15);
}
.input-field.success {
  border-color: var(--green);
}

.input-with-icon {
  position: relative;
}
.input-with-icon .input-field {
  padding-left: 44px;
}
.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  transition: color var(--transition-fast);
}
.input-with-icon .input-field:focus ~ .input-icon {
  color: var(--orange-accent);
}

.input-with-toggle .input-field {
  padding-right: 44px;
}
.input-toggle-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  transition: color var(--transition-fast);
}
.input-toggle-btn:hover {
  color: var(--orange-accent);
}

.input-error-msg {
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Select ---- */
select.input-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
select.input-field option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-success {
  background: var(--green-bg);
  color: var(--green);
}
.badge-danger {
  background: var(--red-bg);
  color: var(--red);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--yellow);
}
.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue);
}
.badge-orange {
  background: var(--orange-glow);
  color: var(--orange-accent);
}
.badge-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Status badges */
.status-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.status-processing {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.status-completed {
  background: var(--green-bg);
  color: var(--green);
}
.status-failed {
  background: var(--red-bg);
  color: var(--red);
}
.status-cancelled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* ---- Layout Helpers ---- */
.flex {
  display: flex;
}
.flex-col {
  display: flex;
  flex-direction: column;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.gap-xs {
  gap: var(--space-xs);
}
.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}
.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
.overflow-hidden {
  overflow: hidden;
}

/* ---- Section Header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--orange-accent);
}

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
}
.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 13px;
  margin: var(--space-md) 0;
}
.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Loading / Shimmer ---- */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton {
  border-radius: var(--radius-md);
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-title {
  height: 20px;
  margin-bottom: 12px;
  width: 60%;
}
.skeleton-circle {
  border-radius: 50%;
}
.skeleton-btn {
  height: 48px;
  border-radius: var(--radius-pill);
}

/* ---- Toast / Snackbar ---- */
.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: all;
}
.toast.toast-out {
  animation: toastOut 0.2s ease forwards;
}
.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toast-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}
.toast-success {
  border-left: 3px solid var(--green);
}
.toast-error {
  border-left: 3px solid var(--red);
}
.toast-warning {
  border-left: 3px solid var(--yellow);
}
.toast-info {
  border-left: 3px solid var(--blue);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  background: var(--bg-secondary);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-width: 480px;
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  border-bottom: none;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 99px;
  margin: 0 auto var(--space-lg);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-align: center;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-nav-h);
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-sticky);
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  position: relative;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
  color: var(--orange-accent);
}
.nav-item.active .nav-icon {
  transform: scale(1.15);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--orange-primary),
    var(--orange-accent)
  );
  border-radius: 0 0 3px 3px;
}

.nav-icon {
  font-size: 22px;
  transition: transform var(--transition-fast);
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-secondary);
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
}

/* FAB — Floating Action Button */
.nav-fab {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--orange-primary),
    var(--orange-accent)
  );
  box-shadow: var(--shadow-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  border: none;
  position: relative;
  bottom: 10px;
  transition:
    transform var(--transition-normal),
    box-shadow var(--transition-normal);
  -webkit-tap-highlight-color: transparent;
}
.nav-fab:active {
  transform: scale(0.93);
}
.nav-fab:hover {
  box-shadow: 0 12px 40px rgba(201, 106, 25, 0.55);
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--space-lg);
  height: var(--header-h);
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-sticky);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  font-size: 18px;
  transition: background var(--transition-fast);
}
.header-back:hover {
  background: var(--bg-hover);
}

.header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-action {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  font-size: 18px;
  position: relative;
  transition: background var(--transition-fast);
}
.header-action:hover {
  color: var(--orange-accent);
  background: var(--bg-hover);
}

/* ---- Scrollable Page Content ---- */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottom-nav-h) + 48px);
}
.page-content.no-nav {
  padding-bottom: var(--space-xl);
}
.page-pad {
  padding: 0 var(--space-lg);
}

/* ---- Coin Icon ---- */
.coin-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  background: var(--orange-primary);
}
.coin-icon-sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
}
.coin-icon-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}
.coin-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ---- Transaction Row ---- */
.tx-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-radius: var(--radius-md);
}
.tx-row:last-child {
  border-bottom: none;
}
.tx-row:hover {
  background: var(--bg-hover);
  padding-left: 8px;
  padding-right: 8px;
}

.tx-info {
  flex: 1;
  min-width: 0;
}
.tx-title {
  font-size: 14px;
  font-weight: 600;
}
.tx-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tx-amount {
  text-align: right;
}
.tx-value {
  font-size: 15px;
  font-weight: 700;
}
.tx-value.positive {
  color: var(--green);
}
.tx-value.negative {
  color: var(--red);
}
.tx-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Balance Card ---- */
.balance-card {
  background: linear-gradient(135deg, #1a1f2e 0%, #161b22 50%, #1a1f2e 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--orange-glow) 0%, transparent 70%);
  pointer-events: none;
}
.balance-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.balance-amount {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
}
.balance-currency {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* ---- Quick Action Buttons ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.quick-action-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--orange-accent);
  transition: all var(--transition-normal);
}
.quick-action:hover .quick-action-icon {
  background: var(--orange-glow);
  border-color: var(--orange-primary);
  transform: translateY(-2px);
}
.quick-action:active .quick-action-icon {
  transform: scale(0.93);
}
.quick-action-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

/* ---- Slider / Carousel ---- */
.slider-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}
.slider-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.slider-slide {
  min-width: 100%;
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  position: relative;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: var(--space-md);
}
.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-tertiary);
  transition: all var(--transition-normal);
  cursor: pointer;
}
.slider-dot.active {
  width: 20px;
  background: var(--orange-accent);
}

/* ---- Market Ticker Card ---- */
.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--transition-normal);
  cursor: pointer;
  margin-bottom: 10px;
}
.market-card:last-child {
  margin-bottom: 0;
}
.market-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.market-info {
  flex: 1;
  min-width: 0;
}
.market-name {
  font-size: 14px;
  font-weight: 700;
}
.market-symbol {
  font-size: 12px;
  color: var(--text-muted);
}
.market-price {
  text-align: right;
}
.market-price-val {
  font-size: 15px;
  font-weight: 700;
}
.market-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.market-change.positive {
  color: var(--green);
}
.market-change.negative {
  color: var(--red);
}

/* ---- Keyframe Animations ---- */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

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

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

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  80% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes particleDrift {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20vh) translateX(50px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes coinBounce {
  0% {
    transform: translateY(-60px) scale(0);
    opacity: 0;
  }
  40% {
    transform: translateY(0) scale(1.1);
    opacity: 1;
  }
  60% {
    transform: translateY(-12px) scale(1);
  }
  75% {
    transform: translateY(0) scale(1.05);
  }
  90% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes logoReveal {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

@keyframes dotPulse {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--orange-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

/* ---- Dot loader ---- */
.dot-loader {
  display: flex;
  gap: 5px;
  align-items: center;
}
.dot-loader span {
  width: 8px;
  height: 8px;
  background: var(--orange-accent);
  border-radius: 50%;
  animation: dotPulse 1.2s infinite;
}
.dot-loader span:nth-child(2) {
  animation-delay: 0.2s;
}
.dot-loader span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ---- Progress Bar ---- */
.progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--orange-primary),
    var(--orange-accent)
  );
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* ---- Avatar ---- */
.avatar {
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--orange-accent);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.avatar-md {
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
}
.avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 32px;
}

/* ---- Responsive Breakpoints ---- */
@media (min-width: 481px) {
  .page-wrapper {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  }
}

@media (max-width: 360px) {
  :root {
    font-size: 14px;
  }
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .quick-action-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* ---- Safe Area (iPhone notch) ---- */
.safe-top {
  padding-top: env(safe-area-inset-top);
}
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---- Number Toggle (USD/NGN) ---- */
.currency-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.currency-toggle-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--transition-fast);
}
.currency-toggle-btn.active {
  background: var(--orange-primary);
  color: #fff;
  box-shadow: var(--shadow-orange);
}
