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

/* ─── Brand colors ─────────────────────────────────────── */
:root {
  --nav-primary: #1e3272;
  --nav-primary-dark: #16265c;
}

/* ─── Layout shift guard ───────────────────────────────── */
#navbar-placeholder {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  min-height: 64px;
  background: var(--nav-primary);
}

/* ─── Nav base ─────────────────────────────────────────── */
.top-nav {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 767px) {
  .nav-center { display: none !important; }
  .mobile-hamburger { display: flex !important; }
  .mobile-raktar-btn { display: flex !important; }
  .user-name-display { display: none !important; }
}
@media (min-width: 768px) {
  .mobile-hamburger { display: none !important; }
  .mobile-raktar-btn { display: none !important; }
}

/* ─── Nav button hover & active ────────────────────────── */
.nav-btn, .nav-btn-direct {
  color: #fff !important;
  transition: background 0.15s, color 0.15s !important;
  transform: none !important;
}
.user-profile-toggle:hover {
  background: rgba(255,255,255,0.15) !important;
}
.nav-btn:hover, .nav-btn-direct:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
  transform: none !important;
}
.nav-btn.active, .nav-btn-direct.active {
  color: #fff !important;
  font-weight: 600 !important;
  background: rgba(255,255,255,0.18) !important;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,0.85) !important;
}
.dropdown-content a.active {
  color: var(--nav-primary) !important;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--nav-primary);
  background: #eef2ff !important;
}

/* ─── Dropdown show on hover ───────────────────────────── */
.nav-dropdown:hover .dropdown-content,
.dropdown-content:hover {
  display: block !important;
}
.nav-dropdown {
  position: relative;
}
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 10px;
}
.dropdown-content a:hover { background: #f1f5f9; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.dropdown-content { animation: dropdownIn 0.15s ease-out; }

/* ─── Mobile overlay ───────────────────────────────────── */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9997;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mobile-menu-overlay.open { display: block; }

/* ─── Mobile drawer ────────────────────────────────────── */
.mobile-menu-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--nav-primary);
  z-index: 9998;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.2,0,0,1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 32px rgba(0,0,0,0.3);
  overflow-y: auto;
}
.mobile-menu-drawer.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.mobile-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 32px;
}
.mobile-menu-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 16px 20px 4px;
}
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.mobile-menu-item:hover, .mobile-menu-item:active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.mobile-menu-item svg { flex-shrink: 0; opacity: 0.75; }

/* ─── Hamburger animation ──────────────────────────────── */
.mobile-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}
.mobile-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── User profile dropdown (JS-toggled) ───────────────── */
.user-profile-menu {
  display: none;
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  background: #fff !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08) !important;
  border: 1px solid #e8eaf0 !important;
  min-width: 260px !important;
  padding: 8px !important;
  z-index: 10001 !important;
  backdrop-filter: none !important;
}
.user-profile-dropdown.open .user-profile-menu { display: block !important; }

.user-profile-menu-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
}
.user-menu-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #eef2ff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; overflow: hidden;
}
.user-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-info { flex: 1; min-width: 0; }
.user-menu-name {
  font-size: 14px; font-weight: 600; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu-email {
  font-size: 12px; color: #64748b; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-profile-menu-divider { height: 1px; background: #f1f5f9; margin: 4px 8px; }

a.user-profile-menu-item, button.user-profile-menu-item {
  display: flex !important; align-items: center !important; gap: 12px !important;
  width: 100% !important; padding: 10px 16px !important;
  font-size: 14px !important; color: #334155 !important; text-decoration: none !important;
  border: 0 !important; background: transparent !important; cursor: pointer !important;
  border-radius: 10px !important; transition: background 0.15s !important;
  box-sizing: border-box !important; font-family: inherit !important;
  transform: none !important;
}
a.user-profile-menu-item:hover,
button.user-profile-menu-item:hover { background: #f1f5f9 !important; color: #334155 !important; }
.user-profile-menu-item.logout { color: #ef4444 !important; }
.user-profile-menu-item.logout:hover { background: #fff5f5 !important; color: #ef4444 !important; }
.user-profile-menu-item svg { opacity: 0.7; flex-shrink: 0; }

/* ─── User avatar ──────────────────────────────────────── */
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Online tooltip ───────────────────────────────────── */
.navbar-online-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  border: 1px solid #e8eaf0;
  min-width: 220px; max-width: 280px;
  padding: 8px; z-index: 10002;
}
.navbar-online-tooltip.visible { display: block; }

.tooltip-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 6px;
  font-size: 12px; font-weight: 600; color: #475569;
  border-bottom: 1px solid #f1f5f9; margin-bottom: 4px;
}
.tooltip-list { max-height: 240px; overflow-y: auto; }
.tooltip-loading, .tooltip-empty {
  padding: 12px; font-size: 13px; color: #94a3b8; text-align: center;
}
.tooltip-user-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
}
.tooltip-user-item:hover { background: #f8fafc; }
.tooltip-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #eef2ff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; overflow: hidden;
}
.tooltip-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tooltip-user-name { font-size: 13px; font-weight: 500; color: #1e293b; flex: 1; }
.tooltip-status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex-shrink: 0;
}
