/* =============================================================
   GhostLink — Global App Styles
   Minimalist dark glassmorphism, Inter typeface, violet accent
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --accent:        #7c3aed;
  --accent-light:  #a78bfa;
  --accent-hover:  #6d28d9;
  --accent-glow:   rgba(124, 58, 237, 0.35);

  --bg:            #07040f;
  --surface:       rgba(15, 10, 28, 0.82);
  --surface-2:     rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border:        rgba(124, 58, 237, 0.18);
  --border-soft:   rgba(255, 255, 255, 0.07);

  --text:          #ede8f9;
  --text-2:        #b0a8c8;
  --text-muted:    #5e5878;

  --green:         #22c55e;
  --green-soft:    rgba(34, 197, 94, 0.15);
  --red:           #ef4444;
  --red-soft:      rgba(239, 68, 68, 0.12);
  --red-text:      #fca5a5;

  --radius:        14px;
  --radius-sm:     10px;
  --radius-xs:     7px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-body {
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(124, 58, 237, 0.2) 0%, transparent 65%),
    radial-gradient(ellipse 35% 25% at 85% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 55%);
}

/* ── App Nav ──────────────────────────────────────────────── */
.app-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: rgba(7, 4, 15, 0.75);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-logo:hover { color: var(--accent-light); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-active { color: var(--text) !important; background: rgba(124, 58, 237, 0.12) !important; }

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.nav-link-btn:hover { color: var(--red-text); background: var(--red-soft); }

.nav-shop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.nav-shop-btn:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.5);
}

/* ── Glass Card ───────────────────────────────────────────── */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--red-text);
}
.btn-danger:hover { background: var(--red-soft); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-full { width: 100%; }

/* ── Inputs ───────────────────────────────────────────────── */
.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: rgba(124, 58, 237, 0.6);
  background: rgba(124, 58, 237, 0.05);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* ── Toast / Alerts ───────────────────────────────────────── */
.toast {
  position: fixed;
  top: 72px; left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 9999;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast-success { border-color: rgba(34, 197, 94, 0.4); }
.toast-error   { border-color: rgba(239, 68, 68, 0.4); }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.alert-error   { background: var(--red-soft); border: 1px solid rgba(239,68,68,0.35); color: var(--red-text); }
.alert-success { background: var(--green-soft); border: 1px solid rgba(34,197,94,0.35); color: #86efac; }
.alert-info    { background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.3); color: var(--accent-light); }

/* ── Page scaffold ────────────────────────────────────────── */
.page {
  padding: 72px 20px 48px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}
.page-sm { max-width: 480px; }
.page-md { max-width: 680px; }

/* ── Section titles ───────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-premium {
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: var(--accent-light);
}
.badge-online  { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.badge-offline { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-soft); }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.avatar-placeholder {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: rgba(124, 58, 237, 0.18);
  border: 1.5px solid var(--border);
  color: var(--accent-light);
  flex-shrink: 0;
}
.av-xs { width: 28px; height: 28px; font-size: 11px; }
.av-sm { width: 36px; height: 36px; font-size: 14px; }
.av-md { width: 48px; height: 48px; font-size: 18px; }
.av-lg { width: 64px; height: 64px; font-size: 24px; }
.av-xl { width: 88px; height: 88px; font-size: 32px; }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 20px 0 16px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Scroll — ghost overlay style ─────────────────────────── */
/* Hidden by default, fades in on scroll via JS .is-scrolling class */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.0); border-radius: 4px; transition: background 0.4s; }
html.is-scrolling ::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.38); }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.58) !important; }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
html.is-scrolling * { scrollbar-color: rgba(124, 58, 237, 0.38) transparent; }

/* ── Utilities ────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11.5px; }
.text-center { text-align: center; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.gap-8       { gap: 8px; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Mobile hamburger nav ─────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: background 0.15s;
}
.nav-hamburger:hover { background: var(--surface-hover); }
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-drawer {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: rgba(7, 4, 15, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 199;
  padding: 10px 14px 14px;
  flex-direction: column;
  gap: 3px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: none;
}
.nav-mobile-drawer.open {
  pointer-events: all;
  transform: translateY(0);
  opacity: 1;
}
.nav-mobile-drawer .nav-link,
.nav-mobile-drawer .nav-shop-btn,
.nav-mobile-drawer .nav-link-btn {
  display: flex !important;
  width: 100%;
  padding: 11px 14px;
  font-size: 14.5px;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  justify-content: flex-start;
}
.nav-mobile-drawer .nav-shop-btn {
  margin-top: 4px;
  padding: 11px 14px;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 680px) {
  .app-nav { padding: 0 16px; }
  .page { padding: 68px 14px 40px; }
  /* Hide desktop nav links on mobile, show hamburger */
  .nav-actions { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile-drawer { display: flex; }
}

@media (min-width: 681px) {
  .nav-hamburger { display: none !important; }
  .nav-mobile-drawer { display: none !important; }
}

/* ── Smooth scroll ────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Touch targets (mobile) ───────────────────────────────── */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .input { min-height: 44px; font-size: 16px; } /* 16px prevents iOS zoom */
  .friends-search { font-size: 16px; } /* prevent iOS zoom */
  .chat-input { font-size: 16px; } /* prevent iOS zoom */
}
