/* ============================================
   DOMMY NAVIGATION - Professional Styles
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark body .navbar {
  background: rgba(15, 23, 42, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.navbar.scrolled {
  padding: 0.75rem 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

html.dark body .navbar.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================
   Brand
   ============================================ */
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  z-index: 1001;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  object-fit: contain;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
  background: white;
  padding: 4px;
}

html.dark body .brand-logo-img {
  background: #0f172a;
}

/* ============================================
   Navigation
   ============================================ */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary-indigo);
  background: var(--bg-secondary);
}

html.dark body .nav-link:hover {
  color: var(--primary-purple);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--primary-indigo);
}

html.dark body .nav-link.active {
  color: var(--primary-purple);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 0.875rem;
  right: 0.875rem;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* ============================================
   User Menu
   ============================================ */
.user-menu {
  position: relative;
}

.user-profile-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border-radius: 50px;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font: inherit;
  color: inherit;
}

.user-profile-button:hover {
  background: var(--bg-secondary);
  border-color: var(--neutral-200);
}

html.dark body .user-profile-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--neutral-700);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neutral-200);
}

html.dark body .user-avatar {
  border-color: var(--neutral-700);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.user-profile-button.active .dropdown-icon {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 240px;
  background: var(--bg-primary);
  border: 1px solid var(--neutral-200);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1002;
}

html.dark body .user-dropdown {
  background: var(--bg-secondary);
  border-color: var(--neutral-700);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 0.875rem;
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 0.5rem;
}

html.dark body .user-dropdown-header {
  border-bottom-color: var(--neutral-700);
}

.user-dropdown-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.user-dropdown-email {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.user-dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--primary-indigo);
}

html.dark body .user-dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--primary-purple);
}

.user-dropdown-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--neutral-200);
  margin: 0.5rem 0;
}

html.dark body .user-dropdown-divider {
  background: var(--neutral-700);
}

.user-dropdown-item.danger {
  color: #dc2626;
}

.user-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

html.dark body .user-dropdown-item.danger {
  color: #f87171;
}

html.dark body .user-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--neutral-200);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  font: inherit;
  color: var(--text-primary);
}

.theme-toggle:hover {
  background: var(--neutral-200);
  transform: scale(1.05);
}

html.dark body .theme-toggle {
  background: var(--neutral-700);
  border-color: var(--neutral-600);
}

html.dark body .theme-toggle:hover {
  background: var(--neutral-600);
}

.theme-icon {
  transition: transform 0.2s ease;
}

/* ============================================
   Mobile Menu Toggle
   ============================================ */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  gap: 6px;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   Buttons
   ============================================ */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================
   Mobile Styles
   ============================================ */
@media (max-width: 925px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .navbar-actions {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
  }

  .navbar-actions.mobile-menu-open {
    transform: translateX(0);
  }

  .navbar-menu-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 360px;
    height: 100%;
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.25rem;
    padding: 5rem 1.5rem 2rem;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  html.dark body .navbar-menu-wrapper {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .nav-link {
    font-size: 1rem;
    padding: 0.875rem 1rem;
    width: 100%;
  }

  .nav-link.active::after {
    left: 1rem;
    right: 1rem;
  }

  .btn-sm {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    justify-content: center;
  }

  .user-menu {
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--neutral-200);
  }

  html.dark body .user-menu {
    border-top-color: var(--neutral-700);
  }

  .user-profile-button {
    width: 100%;
    justify-content: flex-start;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
  }

  .user-dropdown {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: none;
    border: 1px solid var(--neutral-200);
  }

  html.dark body .user-dropdown {
    border-color: var(--neutral-700);
  }

  .theme-toggle {
    margin-top: 1rem;
    width: 100%;
    border-radius: 0.75rem;
    height: 48px;
  }
}

@media (max-width: 360px) {
  .navbar-menu-wrapper {
    width: 90%;
  }
}

/* ============================================
   Accessibility
   ============================================ */
.nav-link:focus-visible,
.user-profile-button:focus-visible,
.user-dropdown-item:focus-visible,
.theme-toggle:focus-visible,
.mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--primary-indigo);
  outline-offset: 2px;
}

html.dark body .nav-link:focus-visible,
html.dark body .user-profile-button:focus-visible,
html.dark body .user-dropdown-item:focus-visible,
html.dark body .theme-toggle:focus-visible,
html.dark body .mobile-menu-toggle:focus-visible {
  outline-color: var(--primary-purple);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
