/* ═══════════════════════════════════════════════════
   AURUM — Shared App Components
   ═══════════════════════════════════════════════════ */

@import url('./tokens.css');

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  width: 100%;
  overflow-x: clip;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

img { display: block; max-width: 100%; }

/* — Status Bar (iOS-style) — */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--bg);
}
.status-bar .time { font-variant-numeric: tabular-nums; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }

/* — Bottom Navigation — */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 env(safe-area-inset-bottom, 20px);
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: var(--z-nav);
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--duration-fast) var(--ease-out);
  text-decoration: none;
  cursor: pointer;
}
.bottom-nav .nav-item:hover { color: var(--fg-secondary); }
.bottom-nav .nav-item.active { color: var(--gold); }
.bottom-nav .nav-item svg { width: 22px; height: 22px; }
.bottom-nav .nav-item .scan-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
  box-shadow: 0 4px 20px var(--gold-glow);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.bottom-nav .nav-item .scan-btn:hover { transform: scale(1.08); }
.bottom-nav .nav-item .scan-btn svg { width: 26px; height: 26px; color: var(--fg-inverse); }

/* — Home Indicator — */
.home-indicator {
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: var(--fg);
  opacity: 0.2;
  margin: 0 auto;
}

/* — Buttons — */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--fg-inverse);
  box-shadow: 0 2px 12px var(--gold-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 20px var(--gold-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--fg); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }

/* — Input Fields — */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-secondary);
}
.input-field {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color var(--duration-fast);
  width: 100%;
}
.input-field::placeholder { color: var(--muted); }
.input-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* — Cards — */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: all var(--duration-fast) var(--ease-out);
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.card-gold {
  border-color: var(--border-gold);
  background: linear-gradient(135deg, var(--surface), rgba(200, 165, 92, 0.03));
}

/* — Badges — */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.badge-verified { background: var(--verified-bg); color: var(--verified); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-gold { background: var(--gold-glow); color: var(--gold); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* — Section Headers — */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
}
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
}
.section-action {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  cursor: pointer;
}

/* — Dividers — */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-4) 0;
}

/* — Scroll Container — */
.scroll-x {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--sp-2);
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; flex-shrink: 0; }

/* — Page Content (below status bar, above bottom nav) — */
.page-content {
  padding: 0 20px 100px;
  max-width: 430px;
  margin: 0 auto;
  width: 100%;
  overflow-x: clip;
}

/* — Animations — */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scanLine {
  0% { top: 0; opacity: 1; }
  50% { opacity: 0.6; }
  100% { top: 100%; opacity: 1; }
}

.fade-in { animation: fadeIn 0.4s var(--ease-out) both; }
.fade-in-delay-1 { animation-delay: 0.08s; }
.fade-in-delay-2 { animation-delay: 0.16s; }
.fade-in-delay-3 { animation-delay: 0.24s; }
.fade-in-delay-4 { animation-delay: 0.32s; }

/* — Typography Utilities — */
.text-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
}
.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-secondary { color: var(--fg-secondary); }
.text-verified { color: var(--verified); }
.text-danger { color: var(--danger); }

/* — Utility — */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
