/* ============================================================
   ИТД Watch — Design System
   ============================================================ */

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

:root {
  --bg-0: #060608;
  --bg-1: #0d0d10;
  --bg-2: #131318;
  --bg-3: #1a1a20;
  --bg-4: #22222a;

  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);

  --text-0: #f0eeff;
  --text-1: rgba(240,238,255,0.78);
  --text-2: rgba(240,238,255,0.50);
  --text-3: rgba(240,238,255,0.30);

  --accent: #7c6bff;
  --accent-dim: rgba(124,107,255,0.18);
  --accent-glow: 0 0 24px rgba(124,107,255,0.35);

  --risk-safe:        #34d399;
  --risk-suspicious:  #fbbf24;
  --risk-dangerous:   #f87171;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --glass-bg: rgba(255,255,255,0.035);
  --glass-border: rgba(255,255,255,0.07);
  --glass-blur: blur(20px);

  --shadow-card: 0 4px 32px rgba(0,0,0,0.45);
  --shadow-float: 0 8px 48px rgba(0,0,0,0.6);

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Background ambient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(124,107,255,0.08), transparent),
    radial-gradient(ellipse 40% 60% at 100% 100%, rgba(100,80,200,0.05), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
code, .mono { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }

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

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.page { padding: 32px 0 64px; }

/* ── Glass Cards ── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  padding: 20px;
}

.card-elevated {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font: 500 13px/1 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(124,107,255,0);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: var(--accent-glow); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-1);
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: var(--border-hover); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.3); color: #f87171; }
.btn-danger:hover { background: rgba(248,113,113,0.25); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Inputs ── */
.input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-0);
  font: 14px 'Inter', sans-serif;
  padding: 10px 14px;
  outline: none;
  transition: var(--transition);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input::placeholder { color: var(--text-3); }

select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 80px; }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 12px; font-weight: 500; color: var(--text-2); }

/* ── Risk badges ── */
.risk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.risk-safe        { background: rgba(52,211,153,0.1); color: var(--risk-safe); border: 1px solid rgba(52,211,153,0.2); }
.risk-suspicious  { background: rgba(251,191,36,0.1); color: var(--risk-suspicious); border: 1px solid rgba(251,191,36,0.2); }
.risk-dangerous   { background: rgba(248,113,113,0.1); color: var(--risk-dangerous); border: 1px solid rgba(248,113,113,0.2); }

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--accent-dim);
  color: #a99fff;
  border: 1px solid rgba(124,107,255,0.2);
}

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 52px; height: 52px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 110px; height: 110px; border: 3px solid var(--bg-1); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab {
  padding: 10px 18px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
  border: none;
  background: none;
  position: relative;
}
.tab::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: var(--transition);
}
.tab.active { color: var(--text-0); }
.tab.active::after { transform: scaleX(1); }
.tab:hover { color: var(--text-1); }

.tab-content { padding-top: 20px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,6,8,0.85);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  text-decoration: none;
}

.nav-brand .eye-mini { width: 36px; height: 20px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* ── Header eye banner ── */
.eye-header {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: block;
}

/* ── Post card ── */
.post-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  margin-bottom: 10px;
  transition: var(--transition);
}
.post-card:hover { border-color: var(--border-hover); background: var(--bg-2); }
.post-card.pinned { border-color: rgba(124,107,255,0.3); }

.post-meta { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin-bottom: 8px; }
.post-stats { display: flex; gap: 14px; margin-top: 10px; }
.post-stat { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }

.post-media { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.post-media img { border-radius: var(--radius-sm); max-width: 220px; max-height: 150px; object-fit: cover; }

/* ── History timeline ── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--border); border-radius: 1px; }

.timeline-item {
  position: relative;
  padding: 0 0 16px 16px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-0);
}
.timeline-date { font-size: 11px; color: var(--text-3); margin-bottom: 2px; font-family: 'JetBrains Mono', monospace; }
.timeline-field { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.timeline-change { font-size: 13px; }
.timeline-old { color: var(--text-3); text-decoration: line-through; }
.timeline-new { color: var(--text-0); }

/* ── User cards (dashboard) ── */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.user-card:hover { background: var(--bg-2); border-color: var(--border-hover); transform: translateY(-1px); box-shadow: var(--shadow-card); }

.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-handle { font-size: 12px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.user-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* ── Profile header ── */
.profile-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-3);
}

.profile-header { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }
.profile-header-body { padding: 0 24px 20px; position: relative; }
.profile-avatar-wrap { margin-top: -48px; margin-bottom: 12px; }
.profile-name { font-size: 1.5rem; font-weight: 700; }
.profile-handle { color: var(--text-3); font-family: 'JetBrains Mono', monospace; font-size: 13px; margin-bottom: 6px; }
.profile-stats { display: flex; gap: 20px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.profile-stat strong { font-weight: 600; color: var(--text-0); }

.profile-actions { position: absolute; top: 16px; right: 24px; display: flex; gap: 8px; }

/* ── Admin panel ── */
.admin-section { }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .admin-grid { grid-template-columns: 1fr; } }

/* ── Note card ── */
.note-card {
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.note-card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.note-card-author { font-size: 12px; font-weight: 500; color: var(--accent); }
.note-card-date { font-size: 11px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }

/* ── Search / top bar ── */
.search-bar { display: flex; gap: 10px; }
.search-bar .input { max-width: 340px; }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── Empty / error states ── */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty svg { margin-bottom: 12px; opacity: 0.3; }
.alert-err { padding: 12px 16px; background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); border-radius: var(--radius-sm); color: #fca5a5; font-size: 13px; }

/* ── Verified badge ── */
.verified { display: inline-block; width: 16px; height: 16px; background: var(--accent); border-radius: 50%; position: relative; vertical-align: middle; }
.verified::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; color: white; font-weight: 700; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); filter: brightness(1.3); }

/* ── Utils ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-2); }
.text-right { text-align: right; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.justify-between { justify-content: space-between; }
