/* ==========================================================================
   SkyLogs Navbar
   Sticky, accessible, premium navigation
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-navbar, 1100);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

.navbar.scrolled {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  border-bottom-color: var(--color-border, #e2e8f0);
}

.navbar:not(.scrolled) {
  border-bottom-color: transparent;
}

.navbar-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 0.25rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.navbar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.navbar-brand-link:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-primary-500, #3b82f6);
  border-radius: 6px;
  outline: none;
}

.brand-logo {
  height: 32px;
  width: auto;
}

.brand-name {
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.25rem;
}

/* ---------- Nav Links (center) ---------- */

.navbar-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  border-radius: 8px;
  transition: color 150ms ease, background-color 150ms ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #2563eb;
  background-color: #f1f5f9;
}

.nav-link:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
  outline: none;
}

.nav-link.active {
  color: #2563eb;
  background-color: #eff6ff;
}

.nav-link-cta {
  background-color: #2563eb;
  color: #ffffff !important;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
}

.nav-link-cta:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Logout button (button_to generates a form) */
.nav-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- Utility area (right) ---------- */

.navbar-utility {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* ---------- User Avatar Dropdown ---------- */

.nav-user-menu {
  position: relative;
}

.nav-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #f1f5f9;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  overflow: hidden;
}

.nav-avatar-btn:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.nav-avatar-btn:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
  outline: none;
}

.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nav-avatar-initials {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  line-height: 1;
}

.nav-avatar-premium {
  position: absolute;
  bottom: -2px;
  right: -4px;
  font-size: 0.65rem;
  pointer-events: none;
}

.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  padding: 0.5rem;
  z-index: 100;
}

.nav-user-menu.open .nav-user-dropdown {
  display: block;
}

.nav-user-info {
  padding: 0.625rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
}

.nav-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1e293b;
}

.nav-user-email {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 1px;
}

.nav-user-dropdown .nav-link {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 6px;
}

.nav-user-dropdown .nav-link:hover {
  background-color: #f1f5f9;
}

/* ---------- Dropdown Menus ---------- */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
  font-family: inherit;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  color: #2563eb;
  background-color: #f1f5f9;
}

.nav-dropdown-toggle:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
  outline: none;
}

.nav-dropdown-toggle.active {
  color: #2563eb;
}

.dropdown-arrow {
  font-size: 0.625rem;
  transition: transform 200ms ease;
  opacity: 0.6;
}

.nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  padding: 0.5rem;
  z-index: 100;
}

.nav-dropdown-menu--wide {
  min-width: 220px;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu .nav-link {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 6px;
}

.nav-dropdown-menu .nav-link:hover {
  background-color: #f1f5f9;
}

.nav-dropdown-menu .nav-link.active {
  background-color: #eff6ff;
}

/* Dropdown section headers */
.nav-dropdown-section-header {
  display: block;
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

/* Dropdown divider */
.nav-dropdown-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 0.375rem 0.5rem;
}

/* ---------- Mobile Menu Toggle ---------- */

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  gap: 5px;
}

.mobile-menu-toggle:hover {
  background-color: #f1f5f9;
}

.mobile-menu-toggle:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
  outline: none;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #0f172a;
  border-radius: 1px;
  transition: transform 300ms ease, opacity 200ms ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Mobile Menu ---------- */

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem 1.5rem 1.5rem;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu .nav-link {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  min-height: 48px;
}

.mobile-menu .nav-link-cta {
  margin: 0.5rem 0 0;
  justify-content: center;
}

.mobile-menu .nav-dropdown {
  width: 100%;
}

.mobile-menu .nav-dropdown-toggle {
  width: 100%;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  min-height: 48px;
}

.mobile-menu .nav-dropdown-menu {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  border: none;
  background-color: #f1f5f9;
  margin-top: 0.25rem;
  padding: 0.5rem;
  display: none;
  border-radius: 8px;
}

.mobile-menu .nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.mobile-menu .nav-dropdown-menu .nav-link {
  padding-left: 1.5rem;
}

/* Mobile user section */
.mobile-user-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.mobile-user-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.75rem;
}

.mobile-user-header .nav-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.mobile-user-header .nav-avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

.mobile-user-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1e293b;
}

.mobile-nav-link {
  color: #0f172a;
  text-decoration: none;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.mobile-nav-link:hover {
  background-color: #f1f5f9;
}

/* ---------- Upload CTA ---------- */

.nav-link-upload {
  background: var(--color-primary-600, #2563eb) !important;
  color: white !important;
  border-radius: var(--radius-md, 6px);
  padding: 4px 12px !important;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: background 0.15s;
}

.nav-link-upload:hover {
  background: var(--color-primary-700, #1d4ed8) !important;
  color: white !important;
}

/* ---------- Mentor Studio link ---------- */

.nav-link-mentor {
  color: var(--color-primary-600, #2563eb) !important;
  font-weight: 600;
  border-left: 2px solid var(--color-primary-200, #bfdbfe);
  padding-left: 12px !important;
}

.nav-link-mentor.active {
  color: var(--color-primary-700, #1d4ed8) !important;
}

/* ---------- Notification Bell ---------- */

.notification-bell {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: var(--space-1, 0.25rem);
}

.notification-bell .bell-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--color-danger-500, #ef4444);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full, 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--color-bg-surface, white);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 8px);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1));
  z-index: 1000;
  display: none;
}

.notification-dropdown.open {
  display: block;
}

.notification-dropdown-header {
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-dropdown-header h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.notification-item {
  display: flex;
  gap: var(--space-3, 0.75rem);
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  border-bottom: 1px solid var(--color-border-light, #f1f5f9);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.notification-item:hover {
  background: var(--color-bg-hover, #f8fafc);
}

.notification-item.unread {
  background: rgba(37, 99, 235, 0.04);
}

.notification-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-item-body {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary, #1e293b);
  margin-bottom: 2px;
}

.notification-item-message {
  font-size: 0.75rem;
  color: var(--color-text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-time {
  font-size: 0.7rem;
  color: var(--color-text-tertiary, #94a3b8);
  margin-top: 2px;
}

.notification-empty {
  padding: var(--space-6, 1.5rem);
  text-align: center;
  color: var(--color-text-tertiary, #94a3b8);
  font-size: 0.85rem;
}

.bell-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  position: relative;
  display: flex;
  align-items: center;
}

.bell-btn:hover .bell-icon {
  transform: scale(1.1);
}

.bell-icon {
  transition: transform 0.15s;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .navbar-links {
    gap: 0.125rem;
  }

  .nav-link, .nav-dropdown-toggle {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .navbar-content {
    padding: 0 1rem;
  }

  .navbar-links {
    display: none;
  }

  .navbar-utility {
    margin-left: auto;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .navbar-content {
    padding: 0 0.75rem;
  }
}
