/* PartyOps — shared components & design tokens */

/* Inter variable font (self-hosted for offline PWA) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Inter-latin.var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design tokens — single source of truth */
:root {
  --bg: #000000;
  --surface: #0d0d0d;
  --surface-2: #1a1a1a;
  --border: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --text-tertiary: #48484a;
  --green: #30d158;
  --yellow: #ffd60a;
  --red: #ff453a;
  --gray: #636366;
  --blue: #0a84ff;
  --amber: #ff9f0a;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #000000; }

/* Base body */
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

body:has(.bottom-nav) {
  box-sizing: content-box;
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

/* Hide scrollbars on iOS/Safari while keeping scroll functional */
html, body {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

/* ── Skeleton loaders ── */
.skeleton {
  background: var(--surface-2);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.5s infinite;
}
.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  width: 100%;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: auto;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success { background: #0a2e14; border-color: var(--green); color: var(--green); }
.toast.error   { background: #2e0a0a; border-color: var(--red);   color: var(--red); }
.toast.info    { background: #0a1a2e; border-color: var(--blue);  color: var(--blue); }

/* ── Status badge / dot ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
}
.empty-state button {
  padding: 10px 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
}

/* ── PIN shake animation ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease-in-out; }

/* ── Slide-in for new notes ── */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-in { animation: slideIn 0.25s ease-out; }

/* ── Bottom sheet ── */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 201;
  max-height: 70vh;
  overflow-y: auto;
}
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 12px;
}

/* ── Button spinner ── */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bottom navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #000000;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 16px;
  position: relative;
}
.nav-item.active { color: var(--blue); }
.nav-item svg { width: 24px; height: 24px; }
