/*
 * Shadow Nexus Social — style.css
 * Global shared stylesheet
 *
 * This file contains the canonical CSS custom properties (design tokens)
 * and a small set of utility classes shared across all pages.
 * The full component-level styles live inline in index.html / feed.html
 * to keep the single-file app self-contained.
 *
 * Included by index.html via:  <link rel="stylesheet" href="style.css">
 */

/* ═══════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg-main:   #0B1F3A;
  --bg-card:   #0d2444;
  --bg-input:  #0a1c35;
  --bg-deep:   #071428;
  --bg-deeper: #050f1e;

  /* Brand blues */
  --blue:          #0066FF;
  --neon-blue:     #00AEEF;
  --neon-cyan:     #33c8ff;
  --neon-blue-dim: #007fbb;

  /* Brand green */
  --neon-green:     #39FF14;
  --neon-green-dim: #26cc0f;

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #b8d4f0;
  --text-muted:     #6a90b8;

  /* Borders */
  --border-color: #1a3a5c;

  /* Glow helpers */
  --accent-glow:  rgba(0,174,239,0.30);
  --blue-glow-sm: 0 0 10px rgba(0,174,239,0.50);
  --blue-glow-md: 0 0 22px rgba(0,174,239,0.60);
  --blue-glow-lg: 0 0 44px rgba(0,174,239,0.65);

  /* Misc */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: 0.18s ease;
}

/* ═══════════════════════════════════════════════
   RESET / BASE
   ═══════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--neon-blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,174,239,0.38) rgba(11,31,58,0.5);
}
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: rgba(11,31,58,0.45); }
::-webkit-scrollbar-thumb { background: rgba(0,174,239,0.38); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,174,239,0.65); }

/* ═══════════════════════════════════════════════
   FOCUS RING — keyboard accessibility
   ═══════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════ */

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Flex 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-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-4        { gap: 4px; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }

/* Text helpers */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-blue    { color: var(--neon-blue); }
.text-green   { color: var(--neon-green); }
.text-white   { color: #ffffff; }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.font-bold    { font-weight: 700; }
.font-900     { font-weight: 900; }
.truncate     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Spacing */
.mt-8   { margin-top:    8px; }
.mt-12  { margin-top:   12px; }
.mt-16  { margin-top:   16px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom:12px; }
.mb-16  { margin-bottom:16px; }
.p-12   { padding: 12px; }
.p-16   { padding: 16px; }
.p-20   { padding: 20px; }

/* Display */
.hidden         { display: none !important; }
.block          { display: block; }
.inline-flex    { display: inline-flex; }
.relative       { position: relative; }
.fixed          { position: fixed; }

/* Border radius */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Colors / backgrounds */
.bg-card  { background: var(--bg-card); }
.bg-deep  { background: var(--bg-deep); }
.border-blue { border: 1px solid rgba(0,174,239,0.30); }

/* Glow effects */
.glow-blue-sm { box-shadow: var(--blue-glow-sm); }
.glow-blue-md { box-shadow: var(--blue-glow-md); }
.glow-blue-lg { box-shadow: var(--blue-glow-lg); }

/* Online dot */
.online-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 6px rgba(57,255,20,0.85);
  flex-shrink: 0;
}

/* Animated glow pulse for online indicators */
@keyframes onlineBreath {
  0%,100% { box-shadow: 0 0 4px 1px rgba(57,255,20,0.70), 0 0 12px rgba(57,255,20,0.40); }
  50%     { box-shadow: 0 0 8px 3px rgba(57,255,20,0.95), 0 0 24px rgba(57,255,20,0.65); }
}
.online-dot { animation: onlineBreath 2s ease-in-out infinite; }

/* ═══════════════════════════════════════════════
   PWA INSTALL BANNER
   Shown by script.js when browser fires
   the beforeinstallprompt event.
   ═══════════════════════════════════════════════ */
#pwa-install-banner {
  display: none;
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid rgba(0,174,239,0.45);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  max-width: min(380px, calc(100vw - 32px));
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,102,255,0.35), 0 0 0 1px rgba(0,174,239,0.08);
  gap: 12px;
  align-items: center;
  animation: bannerSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
#pwa-install-banner.visible { display: flex; }

@keyframes bannerSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#pwa-install-banner .banner-icon {
  font-size: 28px;
  flex-shrink: 0;
}
#pwa-install-banner .banner-text {
  flex: 1;
  min-width: 0;
}
#pwa-install-banner .banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}
#pwa-install-banner .banner-sub {
  font-size: 11px;
  color: var(--text-muted);
}
#pwa-install-banner .banner-install {
  background: linear-gradient(135deg, #003d99, #0066FF);
  border: 1px solid rgba(0,174,239,0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
  touch-action: manipulation;
}
#pwa-install-banner .banner-install:hover {
  background: linear-gradient(135deg, #0050cc, #0088ff);
  box-shadow: var(--blue-glow-md);
}
#pwa-install-banner .banner-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}
#pwa-install-banner .banner-dismiss:hover { color: #ffffff; }

/* ═══════════════════════════════════════════════
   UPDATE AVAILABLE TOAST
   Shown by script.js when a new SW is waiting.
   ═══════════════════════════════════════════════ */
