/* ═══════════════════════════════════════════════════════
   VORTEX RP — Global Stylesheet
   v1.0.0 — Production
   ═══════════════════════════════════════════════════════ */

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

/* ── Variables ── */
:root {
  --bg:        #08090d;
  --surface:   #0f1116;
  --surface2:  #161921;
  --surface3:  #1d2029;
  --border:    #1f2330;
  --border2:   #2a2f3f;
  --accent:    #7c5cfc;
  --aglow:     rgba(124,92,252,0.18);
  --accent2:   #fc5c7c;
  --cyan:      #5ce4fc;
  --green:     #3ef5a0;
  --yellow:    #fcd05c;
  --text:      #e8eaf0;
  --muted:     #5a6180;
  --muted2:    #8892aa;
  --topbar-h:  56px;
  --sidebar-w: 220px;
  --right-w:   270px;
  --mob-nav-h: 58px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Archivo', sans-serif; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: 'Archivo', sans-serif; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: 'Archivo', sans-serif; color: var(--text); }
img { display: block; max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Utility ── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: var(--topbar-h);
  background: rgba(8,9,13,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
}
.logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px; letter-spacing: 3px; color: var(--accent);
  flex-shrink: 0; cursor: pointer; user-select: none;
}
.logo sup { font-size: 9px; color: var(--muted); letter-spacing: 1px; vertical-align: super; }

.search-bar {
  flex: 1; max-width: 320px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; }
.search-bar input::placeholder { color: var(--muted); }
.search-icon { color: var(--muted); font-size: 15px; flex-shrink: 0; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  background: none; border: 1px solid var(--border);
  padding: 6px 10px; color: var(--muted2); font-size: 14px;
  transition: all .2s; position: relative; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.notif-dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; background: var(--accent2); border-radius: 50%; border: 2px solid var(--bg); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border: 1px solid var(--border);
  transition: border-color .2s; cursor: pointer; user-select: none;
}
.user-chip:hover { border-color: var(--accent); }

.avatar {
  display: flex; align-items: center; justify-content: center;
  font-family: 'Archivo Black', sans-serif; color: #fff; flex-shrink: 0;
  border-radius: 0;
}
.av-xs  { width: 24px; height: 24px; font-size: 9px; }
.av-sm  { width: 30px; height: 30px; font-size: 11px; }
.av-md  { width: 38px; height: 38px; font-size: 14px; }
.av-lg  { width: 44px; height: 44px; font-size: 16px; }
.av-xl  { width: 80px; height: 80px; font-size: 28px; }

.chip-name   { font-size: 12px; font-weight: 600; line-height: 1.2; }
.chip-handle { font-size: 10px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.admin-tag   { background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 7px; letter-spacing: 1px; text-transform: uppercase; margin-left: 2px; }
.admin-btn   { background: var(--accent); color: #fff; font-family: 'Archivo Black', sans-serif; font-size: 11px; letter-spacing: 1px; padding: 7px 14px; transition: all .2s; }
.admin-btn:hover { background: #9070ff; box-shadow: 0 4px 16px rgba(124,92,252,.35); }

/* ═══════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════ */
.app-outer { padding-top: var(--topbar-h); }
.app-grid {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  max-width: 1180px; margin: 0 auto;
}

/* ── Sidebar ── */
.sidebar {
  padding: 14px 6px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; border-right: 1px solid var(--border);
}
.nav-lbl {
  font-size: 9px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 10px 4px; display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; cursor: pointer;
  color: var(--muted2); font-size: 13px; font-weight: 500;
  transition: all .15s; border-left: 2px solid transparent;
  user-select: none;
}
.nav-item:hover  { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(124,92,252,.06); }
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-size: 10px; font-family: 'JetBrains Mono', monospace; color: #fff; background: var(--accent2); padding: 1px 6px; border-radius: 999px; min-width: 18px; text-align: center; }
.faction-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.nav-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* ── Feed column ── */
.feed-col { border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-height: calc(100vh - var(--topbar-h)); }

/* ── Right column ── */
.right-col {
  padding: 16px 12px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; }

/* ═══════════════════════════════════════════
   PANELS (right column widgets)
═══════════════════════════════════════════ */
.panel { background: var(--surface); border: 1px solid var(--border); margin-bottom: 12px; overflow: hidden; }
.panel-hd {
  font-family: 'Archivo Black', sans-serif; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  color: var(--muted2); display: flex; align-items: center; justify-content: space-between;
}
.panel-hd span { color: var(--accent); font-size: 10px; cursor: pointer; font-weight: 700; }
.stat-grid { padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-box  { background: var(--surface2); padding: 8px 10px; }
.stat-v    { font-family: 'Archivo Black', sans-serif; font-size: 20px; color: var(--accent); line-height: 1; }
.stat-l    { font-size: 10px; color: var(--muted); margin-top: 2px; }
.trend-item { padding: 8px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.trend-item:last-child { border-bottom: none; }
.trend-item:hover { background: var(--surface2); }
.trend-tag { font-size: 12px; font-weight: 700; }
.trend-cnt { font-size: 10px; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.sug-item  { padding: 10px 14px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--border); }
.sug-item:last-child { border-bottom: none; }
.sug-info  { flex: 1; min-width: 0; }
.sug-name  { font-size: 12px; font-weight: 600; cursor: pointer; transition: color .15s; }
.sug-name:hover { color: var(--accent); }
.sug-handle { font-size: 10px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.follow-btn { background: none; border: 1px solid var(--accent); color: var(--accent); font-size: 11px; font-weight: 700; padding: 3px 12px; transition: all .2s; cursor: pointer; }
.follow-btn:hover { background: var(--accent); color: #fff; }
.follow-btn.following { background: var(--surface3); border-color: var(--border2); color: var(--muted); }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-primary   { background: var(--accent); color: #fff; font-family: 'Archivo Black', sans-serif; font-size: 13px; letter-spacing: 1px; padding: 10px 24px; transition: all .2s; cursor: pointer; border: none; }
.btn-primary:hover   { background: #9070ff; box-shadow: 0 4px 20px rgba(124,92,252,.4); }
.btn-secondary { background: none; border: 1px solid var(--border2); color: var(--muted2); font-size: 12px; font-weight: 600; padding: 9px 18px; transition: all .2s; cursor: pointer; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger    { background: rgba(252,92,124,.08); border: 1px solid rgba(252,92,124,.2); color: var(--accent2); font-size: 11px; font-weight: 700; padding: 7px 16px; transition: all .2s; cursor: pointer; }
.btn-danger:hover    { background: rgba(252,92,124,.18); }

/* ═══════════════════════════════════════════
   FORM FIELDS
═══════════════════════════════════════════ */
.field       { margin-bottom: 14px; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label, .form-label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
}
.field input, .field select,
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border2);
  padding: 10px 13px; color: var(--text); font-size: 13px;
  outline: none; transition: all .2s; appearance: none;
}
.field input:focus, .field select:focus,
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--aglow);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select option, .field select option { background: var(--surface); }
.pw-strength { display: flex; gap: 3px; margin-top: 6px; }
.pw-strength div { flex: 1; height: 3px; background: var(--border2); border-radius: 2px; transition: all .3s; }

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: fadeUp .2s ease both;
}
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-title { font-family: 'Archivo Black', sans-serif; font-size: 16px; }
.modal-close { background: none; border: none; color: var(--muted2); font-size: 20px; transition: color .15s; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--accent2); }
.modal-body   { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

.confirm-box { background: var(--surface); border: 1px solid rgba(252,92,124,.3); padding: 32px 28px; width: 100%; max-width: 380px; text-align: center; animation: fadeUp .2s ease both; }
.confirm-icon { font-size: 40px; margin-bottom: 14px; }
.confirm-title { font-family: 'Archivo Black', sans-serif; font-size: 18px; margin-bottom: 10px; }
.confirm-text  { font-size: 13px; color: var(--muted2); margin-bottom: 24px; line-height: 1.65; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--surface); border: 1px solid var(--border2);
  padding: 12px 18px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; box-shadow: 0 16px 40px rgba(0,0,0,.6);
  transform: translateY(60px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  max-width: 300px; pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast-bar  { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes fadeUp      { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: translateY(0) } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-8px) } to { opacity: 1; transform: translateX(0) } }
@keyframes typingBounce{ 0%,60%,100% { transform: translateY(0) } 30% { transform: translateY(-5px) } }
@keyframes pulse       { 0%,100% { opacity: 1 } 50% { opacity: .5 } }

/* ═══════════════════════════════════════════
   MOBILE BOTTOM NAV
═══════════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(8,9,13,.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  height: var(--mob-nav-h);
  justify-content: space-around; align-items: center; padding: 0 4px;
}
.mob-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; color: var(--muted); font-size: 19px;
  padding: 6px 4px; transition: color .15s; position: relative; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mob-btn.active { color: var(--accent); }
.mob-btn-label  { font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; line-height: 1; }
.mob-badge      { position: absolute; top: 2px; right: calc(50% - 16px); background: var(--accent2); color: #fff; font-size: 8px; font-weight: 700; padding: 1px 4px; border-radius: 999px; min-width: 14px; text-align: center; line-height: 1.6; }

/* ═══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════ */

/* Tablet ≤ 1024px: hide right column */
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: var(--sidebar-w) 1fr; }
  .right-col { display: none; }
}

/* Tablet ≤ 800px: icon-only sidebar */
@media (max-width: 800px) {
  :root { --sidebar-w: 54px; }
  .sidebar { padding: 12px 4px; }
  .nav-lbl, .nav-item > span:not(.nav-icon), .faction-dot, .nav-badge { display: none; }
  .nav-item { padding: 10px; justify-content: center; border-left: none; border-bottom: 2px solid transparent; }
  .nav-item.active { background: rgba(124,92,252,.08); border-bottom-color: var(--accent); }
  .nav-divider { margin: 5px 4px; }
  .chip-info { display: none; }
  .admin-tag { display: none; }
  .search-bar { max-width: 200px; }
}

/* Mobile ≤ 600px: full mobile layout */
@media (max-width: 600px) {
  :root { --sidebar-w: 0px; --topbar-h: 52px; }
  .app-grid { grid-template-columns: 1fr; }
  .sidebar, .right-col { display: none; }
  .feed-col { border: none; }
  .mobile-nav { display: flex; }
  .app-outer { padding-bottom: var(--mob-nav-h); }
  #toast { bottom: calc(var(--mob-nav-h) + 10px); right: 10px; left: 10px; max-width: none; }
  .logo { font-size: 18px; letter-spacing: 2px; }
  .logo sup { display: none; }
  .search-bar { max-width: none; flex: 1; }
  .topbar { padding: 0 10px; gap: 8px; }
  .user-chip { padding: 4px; }
  .icon-btn { padding: 6px 8px; }
  .field-row { grid-template-columns: 1fr; }
}

/* ── Search results dropdown ── */
.search-bar { position: relative; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 999;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.sr-section {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.sr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
}
.sr-item:hover { background: var(--surface3); }

.sr-item .sr-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.sr-item .sr-sub   { font-size: 11px; color: var(--muted2); }
.sr-item .sr-badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; margin-left: auto; }

.sr-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ── Upload avatar overlay ── */
.profile-av-overlay {
  cursor: pointer;
  transition: opacity .2s;
}
.profile-av-overlay:hover { opacity: 1 !important; }

/* ── Banner bg image ── */
.banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  border-radius: inherit;
}
