/* ============================================================
   SHELL.CSS — Fuzz-style app shell (public/app.html)
   Custom CSS that Tailwind CDN cannot express. No inline styles.
   ============================================================ */

/* ---------- Brand tokens (mirror tailwind.config below) ---------- */
:root {
  --brand-lime: #d4f54c;
  --brand-lime-hover: #c1e439;
  --brand-dark-bg: #0e0e10;
  --brand-card-bg: #161618;
  --brand-panel-bg: #1c1c1f;
  --brand-border: rgba(255, 255, 255, 0.08);
  --brand-muted: #8e8e93;
  --brand-green: #22c55e;
  --brand-red: #ef4444;
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--brand-dark-bg);
}
::-webkit-scrollbar-thumb {
  background: #28282c;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a40;
}
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---------- Tap highlight / overscroll ---------- */
* {
  -webkit-tap-highlight-color: transparent;
}
html {
  overscroll-behavior-y: none;
}

/* ---------- Typography helpers ---------- */
.font-display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.font-mono-brand {
  font-family: 'Space Mono', monospace;
}

/* ---------- Top loading bar ---------- */
#top-loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100;
  pointer-events: none;
}
.loading-line {
  height: 2px;
  width: 0;
  opacity: 0;
  background: var(--brand-lime);
  transition: width 0.3s ease, opacity 0.3s ease;
}
.loading-line.active {
  width: 70%;
  opacity: 1;
  transition: width 1.2s cubic-bezier(0.1, 0.8, 0.3, 1);
}
.loading-line.done {
  width: 100%;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.4s ease 0.15s;
}

/* ---------- Content transitions (router swaps #content-container) ---------- */
#content-container {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.page-loading-out {
  opacity: 0;
  transform: translateY(10px);
}
.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Sidebar drawer (left slide-out) ---------- */
#sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#sidebar-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  z-index: 95;
  background: var(--brand-card-bg);
  border-right: 1px solid var(--brand-border);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  padding: 20px;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#sidebar-menu.open {
  transform: translateX(0);
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-muted);
  transition: all 0.2s ease;
}
.sidebar-btn:hover {
  color: #fff;
  background: var(--brand-panel-bg);
}
.sidebar-btn.active {
  color: var(--brand-lime);
  background: rgba(212, 245, 76, 0.08);
}
.sidebar-btn i,
.sidebar-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------- Bottom sheet modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  justify-content: flex-end;
}
.modal-backdrop.active {
  display: flex;
}
.sheet {
  background: var(--brand-card-bg);
  border-top: 1px solid var(--brand-border);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.active .sheet {
  transform: translateY(0);
}
.sheet-exit {
  transform: translateY(100%) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 9999px;
  background: #3a3a40;
}

/* ---------- Center modal (generic alert) ---------- */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#modal-box {
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#modal-overlay.open #modal-box {
  transform: scale(1);
}

/* ---------- Fixed footer nav ---------- */
#app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  margin: 0 auto;
  max-width: 480px;
  background: rgba(22, 22, 24, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
#app-footer > div {
  width: 100%;
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  border-radius: 16px;
  color: var(--brand-muted);
  transition: all 0.2s ease;
}
.nav-btn span {
  display: none;
  font-size: 10px;
  margin-top: 2px;
  font-weight: 500;
}
.nav-btn.active {
  color: var(--brand-lime);
  background: rgba(212, 245, 76, 0.1);
}

/* ---------- Numpad / method rows / fields (deposit + wallet modal) ---------- */
.numpad-key {
  height: 56px;
  border-radius: 16px;
  font-size: 24px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.numpad-key:active {
  background: var(--brand-panel-bg);
}
.method-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--brand-panel-bg);
  border: 1px solid var(--brand-border);
  text-align: left;
  transition: all 0.2s ease;
}
.method-row:hover {
  border-color: rgba(212, 245, 76, 0.4);
}
.method-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.field-input {
  width: 100%;
  background: var(--brand-dark-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
}
.field-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.field-input:focus {
  border-color: var(--brand-lime);
}

/* ---------- Cards & panels ---------- */
.card {
  background: var(--brand-panel-bg);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
}
.card-soft {
  background: rgba(28, 28, 31, 0.5);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
}

/* ---------- Buttons ---------- */
.btn-lime {
  background: var(--brand-lime);
  color: #000;
  font-weight: 700;
  border-radius: 14px;
  transition: all 0.2s ease;
}
.btn-lime:hover {
  background: var(--brand-lime-hover);
}
.btn-panel {
  background: var(--brand-panel-bg);
  border: 1px solid var(--brand-border);
  color: #fff;
  border-radius: 14px;
  transition: all 0.2s ease;
}
.btn-panel:hover {
  background: rgba(255, 255, 255, 0.08);
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: var(--brand-panel-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d1d6;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Amount / ticker display ---------- */
.amount-display {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- Sparkline draw-in ---------- */
.sparkline-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 2s ease forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Pulse dot ---------- */
.pulse-dot {
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ---------- Loading dots (kept for fragments/buttons) ---------- */
.loader-dots {
  width: 35px;
  aspect-ratio: 2;
  --_g: no-repeat radial-gradient(circle closest-side, var(--brand-lime) 90%, #0000);
  background: var(--_g) 0% 50%, var(--_g) 50% 50%, var(--_g) 100% 50%;
  background-size: calc(100% / 3) 50%;
  animation: l3 1s infinite linear;
}
.loader-dots-white {
  --_g: no-repeat radial-gradient(circle closest-side, #ffffff 90%, #0000);
}
@keyframes l3 {
  0% { background-position: 0% 50%, 50% 50%, 100% 50%; }
  20% { background-position: 0% 0%, 50% 50%, 100% 50%; }
  40% { background-position: 0% 100%, 50% 0%, 100% 50%; }
  60% { background-position: 0% 50%, 50% 100%, 100% 0%; }
  80% { background-position: 0% 50%, 50% 50%, 100% 100%; }
  100% { background-position: 0% 50%, 50% 50%, 100% 50%; }
}
.btn-loading {
  position: relative;
  pointer-events: none;
}
.btn-loading .btn-text {
  opacity: 0;
}
.btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ---------- PWA standalone spacing ---------- */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
