/* ============================================================
   GRIT — Navbar (clean rebuild)
   navbar.css
   ============================================================ */

:root { --navbar-h: 64px; }

/* ── Shell ───────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  height: var(--navbar-h);
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: rgba(6,7,16,0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 1px 0 rgba(124,124,255,0.08), 0 4px 24px rgba(0,0,0,0.35);
}

/* ── CENTER: Create Post ─────────────────────────────────── */
.nav-create-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 32px;
  background: linear-gradient(135deg, rgba(124,124,255,0.15), rgba(90,90,255,0.1));
  border: 1px solid rgba(124,124,255,0.25);
  border-radius: 12px;
  color: #a89bff;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.2s ease;
  max-width: 280px;
  margin: 0 auto;
  width: 100%;
}
.nav-create-center:hover {
  background: linear-gradient(135deg, #7c7cff, #5a5aff);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,124,255,0.4);
  transform: translateY(-1px);
}

/* ── LEFT: Logo ──────────────────────────────────────────── */
.nav-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #7c7cff, #c77dff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(124,124,255,0.4);
  transition: box-shadow 0.2s, transform 0.2s;
}
.nav-logo-link:hover .nav-logo-mark {
  box-shadow: 0 0 28px rgba(124,124,255,0.7);
  transform: scale(1.06);
}

.nav-wordmark {
  font-family: 'Rajdhani', sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 40%, #a89bff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* ── CENTER: Search bar ──────────────────────────────────── */
.nav-search-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-search-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.nav-search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.nav-search-field {
  width: 100%;
  padding: 10px 70px 10px 42px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.nav-search-field:focus {
  background: rgba(10,12,22,0.9);
  border-color: var(--border-lit);
  box-shadow: 0 0 0 3px var(--purple-dim);
}
.nav-search-field::placeholder { color: var(--text-hint); }

.nav-search-kbd {
  position: absolute;
  right: 12px;
  font-size: 10px;
  color: var(--text-hint);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  padding: 2px 6px;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.18s;
}
.nav-search-field:focus ~ .nav-search-kbd { opacity: 0; }

/* ── RIGHT: Actions ──────────────────────────────────────── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Create button */
.nav-action-btn.nav-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #7c7cff, #5a5aff);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 2px 14px rgba(124,124,255,0.35);
  white-space: nowrap;
}
.nav-action-btn.nav-create:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(124,124,255,0.55);
}

/* Icon pill buttons (Players, Chat) */
.nav-icon-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  position: relative;
}
.nav-icon-pill:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-lit);
  color: var(--text);
}
.nav-panel-wrap.open .nav-icon-pill {
  background: var(--purple-dim);
  border-color: var(--border-lit);
  color: var(--purple);
}

/* Chat live dot */
.chat-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px rgba(93,202,165,0.7);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%,100% { box-shadow: 0 0 5px rgba(93,202,165,0.6); }
  50%      { box-shadow: 0 0 12px rgba(93,202,165,1); }
}

/* ── PANEL BASE ──────────────────────────────────────────── */
.nav-panel-wrap { position: relative; }

.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(8,10,20,0.99);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(124,124,255,0.08), 0 24px 64px rgba(0,0,0,0.8);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.2,0.9,0.3,1);
  backdrop-filter: blur(24px);
  overflow: hidden;
  z-index: 100;
}
.nav-panel-wrap.open .nav-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.panel-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.panel-hint {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-hint);
}

/* ── USERS PANEL ─────────────────────────────────────────── */
.users-panel { width: 320px; }

.panel-search-row {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.panel-search-input {
  width: 100%;
  padding: 9px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-md);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s;
}
.panel-search-input:focus { border-color: var(--purple); }
.panel-search-input::placeholder { color: var(--text-hint); }

.users-results { max-height: 340px; overflow-y: auto; }

.user-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}
.user-result-item:last-child { border-bottom: none; }
.user-result-item:hover { background: rgba(255,255,255,0.04); }

.user-result-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.user-result-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-result-info { flex: 1; min-width: 0; }
.user-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-result-meta { font-size: 12px; color: var(--text-muted); }

.user-follow-btn {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  background: var(--purple-dim);
  border: 1px solid var(--border-lit);
  color: var(--purple);
}
.user-follow-btn:hover { background: rgba(124,124,255,0.25); color: #fff; }
.user-follow-btn.following { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ── CHAT PANEL ──────────────────────────────────────────── */
.chat-panel {
  width: 580px;
  height: 460px;
  right: 0;
}

.chat-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  height: 460px;
}

/* Channel sidebar */
.chat-channels {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.channel-list {
  flex: 1;
  overflow-y: auto;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 2px solid transparent;
}
.channel-item:hover { background: rgba(255,255,255,0.04); }
.channel-item.active {
  background: var(--purple-dim);
  border-left-color: var(--purple);
}
.channel-emoji { font-size: 15px; flex-shrink: 0; }
.channel-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-item.active .channel-name { color: #fff; }

/* Messages area */
.chat-messages-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-hint);
  font-size: 13px;
}
.chat-placeholder-icon { font-size: 32px; }

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.chat-header-emoji { font-size: 15px; }
.chat-header-name { font-size: 13px; font-weight: 700; color: var(--text); }
.chat-header-live {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(93,202,165,0.1);
  border: 1px solid rgba(93,202,165,0.25);
  border-radius: 99px;
  padding: 2px 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 10px;
  padding: 6px 14px;
  transition: background 0.1s;
}
.chat-msg:hover { background: rgba(255,255,255,0.02); }

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}
.chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-msg-username { font-size: 13px; font-weight: 700; color: var(--violet); }
.chat-msg-time     { font-size: 10px; color: var(--text-hint); }
.chat-msg-text     { font-size: 13px; color: rgba(230,232,240,0.85); line-height: 1.5; word-break: break-word; }

.chat-msg.own .chat-msg-username { color: var(--teal); }

/* Chat input */
.chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 9px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-md);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s;
}
.chat-input:focus { border-color: var(--purple); }
.chat-input::placeholder { color: var(--text-hint); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--purple);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-send-btn:hover { background: #6a6aff; transform: scale(1.05); }
.chat-send-btn svg { color: #fff; }

/* ── USER MENU ───────────────────────────────────────────── */
.user-menu { position: relative; }

.nav-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
}
.nav-avatar-wrap:hover { background: rgba(255,255,255,0.05); border-color: var(--border); }
.user-menu.open .nav-avatar-wrap { background: var(--purple-dim); border-color: var(--border-lit); }

.nav-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--purple), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(124,124,255,0.35);
  overflow: hidden;
}
.nav-avatar-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }

.nav-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-chevron { color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.user-menu.open .nav-chevron { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: rgba(8,10,20,0.99);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(124,124,255,0.08), 0 24px 64px rgba(0,0,0,0.8);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s cubic-bezier(0.2,0.9,0.3,1);
  backdrop-filter: blur(24px);
  overflow: hidden;
  z-index: 100;
}
.user-menu.open .dropdown { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(124,124,255,0.05);
}
.dropdown-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--purple), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(124,124,255,0.3);
  overflow: hidden;
}
.dropdown-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dropdown-user-info { min-width: 0; }
.dropdown-user-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-user-tag  { font-size: 11px; color: var(--purple); font-weight: 500; }

.dropdown-body { padding: 6px; }
.dropdown a, .dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  background: none;
  border: none;
  color: rgba(230,232,240,0.78);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.dropdown a:hover, .dropdown button:hover { background: rgba(255,255,255,0.06); color: #fff; }
.dropdown-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; transition: background 0.15s;
}
.dropdown a:hover .dropdown-icon,
.dropdown button:hover .dropdown-icon { background: rgba(124,124,255,0.15); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-footer { padding: 6px; border-top: 1px solid var(--border); }
.dropdown button#logout-btn { color: rgba(255,92,92,0.75); font-weight: 500; }
.dropdown button#logout-btn:hover { background: rgba(255,92,92,0.1); color: #ff8a8a; }
.dropdown button#logout-btn .dropdown-icon { background: rgba(255,92,92,0.1); }

/* ── SCROLLBARS ──────────────────────────────────────────── */
.chat-messages-list::-webkit-scrollbar,
.users-results::-webkit-scrollbar,
.channel-list::-webkit-scrollbar { width: 4px; }
.chat-messages-list::-webkit-scrollbar-thumb,
.users-results::-webkit-scrollbar-thumb,
.channel-list::-webkit-scrollbar-thumb { background: rgba(124,124,255,0.25); border-radius: 4px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .navbar { padding: 0 14px; gap: 10px; }
  .nav-search-center { display: none; }
}
@media (max-width: 640px) {
  .nav-username, .nav-chevron { display: none; }
  .nav-icon-pill span { display: none; }
  .nav-icon-pill { padding: 8px 10px; }
  .nav-action-btn.nav-create span { display: none; }
  .nav-action-btn.nav-create { padding: 8px 12px; }
  .chat-panel { width: calc(100vw - 28px); }
  .users-panel { width: calc(100vw - 28px); }
}

/* ── Notifications ────────────────────────────────────────── */
.nav-notif-wrap {
  position: relative;
}

.nav-notif-btn {
  position: relative;
}

.nav-notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: #ff4d6d;
  border-radius: 99px;
  font-size: 10px; font-weight: 700;
  color: #fff; line-height: 18px;
  text-align: center; padding: 0 4px;
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(255,77,109,0.6);
  animation: badgePop 0.25s cubic-bezier(0.2,0.9,0.3,1.2);
}
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.nav-notif-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 360px;
  background: rgba(8,10,20,0.99);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 72px rgba(0,0,0,0.7), 0 0 0 1px rgba(124,124,255,0.08);
  backdrop-filter: blur(24px);
  z-index: 500;
  display: none;
  overflow: hidden;
  animation: panelIn 0.2s cubic-bezier(0.2,0.9,0.3,1) both;
}
.nav-notif-panel.open { display: block; }

@keyframes panelIn {
  from { opacity:0; transform:translateY(-8px) scale(0.97); }
  to   { opacity:1; transform:translateY(0)   scale(1); }
}

.notif-panel-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.notif-panel-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 0.2px;
}
.notif-mark-all-btn {
  background: none; border: none; color: var(--purple);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: color 0.15s;
}
.notif-mark-all-btn:hover { color: var(--violet); }

.notif-list {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,124,255,0.2) transparent;
}

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer; transition: background 0.15s;
  text-decoration: none; color: inherit;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.unread { background: rgba(124,124,255,0.06); }
.notif-item.unread::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--purple), var(--violet));
  border-radius: 0 3px 3px 0;
}

.notif-actor-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.notif-actor-avatar img { width: 100%; height: 100%; object-fit: cover; }

.notif-content { flex: 1; min-width: 0; }
.notif-message {
  font-size: 13px; color: rgba(220,224,240,0.88);
  line-height: 1.5; margin-bottom: 4px;
}
.notif-item.unread .notif-message { color: #fff; font-weight: 500; }
.notif-time { font-size: 11px; color: var(--text-hint); }

.notif-empty {
  padding: 48px 24px; text-align: center;
  color: var(--text-muted); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.notif-empty-icon { font-size: 32px; opacity: 0.35; }

.notif-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  text-align: center;
}
.notif-footer a {
  font-size: 13px; color: var(--purple);
  text-decoration: none; font-weight: 500;
  transition: color 0.15s;
}
.notif-footer a:hover { color: var(--violet); }
