/* ════════════════════════════════════════════════════════════════
   GLOBAL-NAV.CSS — Top Navigation Bar (Facebook-style)
════════════════════════════════════════════════════════════════ */

.global-top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 60px;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
}

.global-top-nav-dark {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: #1E293B;
  backdrop-filter: blur(12px);
}

/* Brand */
.global-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 8px;
}
.global-nav-brand .brand-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  border-radius: 10px;
  display: block;
}
.global-nav-brand .brand-name {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #1E293B;
  letter-spacing: -0.5px;
}
.global-top-nav-dark .global-nav-brand .brand-name {
  color: #F8FAFC;
}

/* Center items */
.global-nav-center {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.global-nav-center::-webkit-scrollbar { display: none; }

.global-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 16px;
  min-width: 72px;
  border-radius: 10px;
  text-decoration: none;
  color: #64748B;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
}
.global-nav-item i {
  font-size: 18px;
  transition: color 0.15s ease;
}
.global-nav-item span {
  font-family: 'Inter', sans-serif;
}
.global-nav-item:hover {
  background: #F1F5F9;
  color: #2563EB;
}
.global-nav-item:hover i { color: #2563EB; }

.global-nav-item.active {
  color: #2563EB;
}
.global-nav-item.active i { color: #2563EB; }
.global-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: #2563EB;
  border-radius: 2px 2px 0 0;
}

/* Dark mode item */
.global-top-nav-dark .global-nav-item {
  color: #94A3B8;
}
.global-top-nav-dark .global-nav-item:hover,
.global-top-nav-dark .global-nav-item.active {
  color: #38BDF8;
  background: rgba(255,255,255,0.05);
}
.global-top-nav-dark .global-nav-item:hover i,
.global-top-nav-dark .global-nav-item.active i { color: #38BDF8; }
.global-top-nav-dark .global-nav-item.active::after { background: #38BDF8; }

/* Actions (right side) */
.global-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

.global-nav-avatar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #1E293B;
  transition: all 0.15s ease;
  max-width: 150px;
}
.global-nav-avatar-link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.global-nav-avatar-link:hover {
  border-color: #2563EB;
  color: #2563EB;
  background: #EFF6FF;
}

.global-top-nav-dark .global-nav-avatar-link {
  background: rgba(255,255,255,0.06);
  border-color: #1E293B;
  color: #E2E8F0;
}
.global-top-nav-dark .global-nav-avatar-link:hover {
  border-color: #38BDF8;
  color: #38BDF8;
  background: rgba(56,189,248,0.08);
}

.global-nav-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s ease;
}
.global-nav-icon-btn:hover {
  background: #FEE2E2;
  color: #EF4444;
  border-color: #EF4444;
}

.global-top-nav-dark .global-nav-icon-btn {
  background: rgba(255,255,255,0.06);
  border-color: #1E293B;
  color: #94A3B8;
}
.global-top-nav-dark .global-nav-icon-btn:hover {
  background: rgba(239,68,68,0.15);
  color: #EF4444;
  border-color: #EF4444;
}

.global-nav-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563EB;
  color: #fff;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}
.global-nav-login:hover {
  background: #1D4ED8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.global-nav-mobile-dropdown {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 12px 32px rgba(15,23,42,0.12);
  z-index: 100;
  flex-direction: column;
  gap: 0;
}

.global-nav-mobile-dropdown.open {
  display: flex;
}

.global-nav-mobile-dropdown .global-nav-item {
  padding: 14px 16px;
  justify-content: flex-start;
}

.global-nav-mobile-dropdown .global-nav-item i {
  margin-right: 12px;
}

/* ── Brand Logo Shared ── */
.brand-logo {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  border-radius: 9px;
  display: inline-block;
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #1E293B;
}

/* ── Modal base ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(15,23,42,.18);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Toast notification ── */
#globalToast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1E293B;
  color: #F8FAFC;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  gap: 8px;
}
#globalToast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#globalToast.success { background: #10B981; }
#globalToast.error   { background: #EF4444; }
#globalToast.info    { background: #2563EB; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .global-nav-mobile-toggle { display: inline-flex; }
  .global-nav-center { display: none; }
  .global-nav-item span { display: none; }
  .global-nav-item { min-width: 44px; padding: 6px 8px; }
  .global-nav-item.active::after { left: 10%; right: 10%; }
  .global-nav-brand .brand-name { display: none; }
}
