/* =====================================================================
   VK-ADMIN v0 — Design Tokens & Base
   Один источник правды для палитры, шрифтов, теней и анимаций.
   Подключается во все мокапы. Менять стили — здесь.
   ===================================================================== */

:root {
  /* ---------- Backgrounds ---------- */
  --bg-base: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #1a1a26;
  --bg-glass: rgba(28, 28, 40, 0.55);

  /* ---------- Borders ---------- */
  --border: #232333;
  --border-hover: #3a3a50;
  --border-focus: #7c5cff;

  /* ---------- Text ---------- */
  --text-hero: #ffffff;
  --text-primary: #f0f0f5;
  --text-secondary: #9090a8;
  --text-muted: #5a5a70;
  --text-disabled: #3a3a4a;

  /* ---------- Brand ---------- */
  --accent: #7c5cff;
  --accent-hover: #8c6cff;
  --accent-glow: rgba(124, 92, 255, 0.18);
  --accent-text: #b3a0ff;

  /* ---------- Semantic ---------- */
  --success: #00d68f;
  --success-bg: rgba(0, 214, 143, 0.12);
  --warning: #ffb84d;
  --warning-bg: rgba(255, 184, 77, 0.12);
  --danger: #ff5c7a;
  --danger-bg: rgba(255, 92, 122, 0.12);
  --info: #4dabff;
  --info-bg: rgba(77, 171, 255, 0.12);

  /* ---------- Metric gradients (Editorial style) ---------- */
  --grad-content: linear-gradient(135deg, #00d4ff 0%, #00ffaa 100%);
  --grad-ads:     linear-gradient(135deg, #ff6b9d 0%, #ffb84d 100%);
  --grad-queue:   linear-gradient(135deg, #b794f6 0%, #f687b3 100%);
  --grad-health:  linear-gradient(135deg, #4ade80 0%, #22d3ee 100%);
  --grad-viral:   linear-gradient(135deg, #ff5c7a 0%, #b794f6 100%);
  --grad-brand:   linear-gradient(135deg, #7c5cff 0%, #b794f6 100%);

  /* ---------- Spacing (4px grid) ---------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px;

  /* ---------- Radii ---------- */
  --r-sm: 8px;  --r-md: 14px; --r-lg: 20px;
  --r-xl: 28px; --r-2xl: 36px; --r-pill: 999px;

  /* ---------- Shadows ---------- */
  --sh-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --sh-card-hover: 0 8px 40px rgba(0, 0, 0, 0.5);
  --sh-glow: 0 0 60px var(--accent-glow);
  --sh-floating: 0 10px 40px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);

  /* ---------- Fonts ---------- */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* ---------- Type scale ---------- */
  --fs-hero: 80px;
  --fs-display-1: 64px;
  --fs-display-2: 48px;
  --fs-h1: 32px;
  --fs-h2: 24px;
  --fs-h3: 18px;
  --fs-body: 14px;
  --fs-small: 12px;
  --fs-xs: 11px;

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 450ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* ---------- Animated aura background (для главного экрана) ---------- */
body.with-aura::before {
  content: '';
  position: fixed;
  inset: -15%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(124, 92, 255, 0.16), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(0, 212, 255, 0.10), transparent 55%),
    radial-gradient(ellipse at 50% 90%, rgba(255, 107, 157, 0.06), transparent 55%);
  pointer-events: none;
  z-index: 0;
  animation: aura 22s ease-in-out infinite alternate;
  filter: blur(40px);
}
@keyframes aura {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(2%, -2%) scale(1.02); }
  100% { transform: translate(-1%, 1%) scale(0.98); }
}

/* ---------- Noise overlay ---------- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ---------- Reusable atoms ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  transition: transform var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--sh-card-hover);
}

.gradient-text {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.display { font-family: var(--font-display); letter-spacing: -0.02em; }

/* ---------- Floating info badges (как в site1: "+18.4%") ---------- */
.float-badge {
  position: absolute;
  background: rgba(22, 22, 31, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  box-shadow: var(--sh-floating);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  font-size: var(--fs-small);
  z-index: 5;
  animation: float-y 6s ease-in-out infinite alternate;
}
.float-badge .label { color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.float-badge .val { font-family: var(--font-mono); font-size: var(--fs-h3); font-weight: 600; margin-top: 2px; }
@keyframes float-y { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }

/* ---------- Pulse dot ---------- */
.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
  flex-shrink: 0;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  animation: pulse 1.8s ease-out infinite;
}
.pulse-dot.warn { background: var(--warning); }
.pulse-dot.err { background: var(--danger); }
.pulse-dot.info { background: var(--info); }
@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ---------- Stagger fade-up on load ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fade-up 750ms var(--ease-out) forwards;
}
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--border-hover); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9d7cff);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 6px 24px var(--accent-glow), var(--sh-glow); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: var(--fs-small); border-radius: var(--r-sm); }

/* ---------- Pills / tags ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.pill.success { color: var(--success); background: var(--success-bg); border-color: transparent; }
.pill.warn { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.pill.err { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.pill.info { color: var(--info); background: var(--info-bg); border-color: transparent; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ---------- Selection ---------- */
::selection { background: var(--accent-glow); color: var(--text-hero); }

/* ---------- Scroll-to-top FAB ---------- */
.scroll-up {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--sh-floating);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-spring),
              border-color var(--t-fast) var(--ease-out);
  z-index: 40;
}
.scroll-up.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-up:hover { border-color: var(--accent); color: var(--accent-text); box-shadow: var(--sh-floating), var(--sh-glow); }
.scroll-up svg { width: 18px; height: 18px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
