/* Advocate Portal Navigation Styles */

/* Root Variables - ensure compatibility */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f0f2f5;
  --text-primary: #000000;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --border-color: #e9ecef;
  --accent: #000000;
  --accent-hover: #1a1a1a;
}

.dark {
  --bg-primary: #000000;
  --bg-secondary: #0f0f0f;
  --bg-tertiary: #141414;
  --text-primary: #ffffff;
  --text-secondary: #a8a8a8;
  --text-muted: #6c6c6c;
  --border-color: #2a2a2a;
  --accent: #ffffff;
  --accent-hover: #e6e6e6;
}

/* Navigation Container */
.advocate-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Left Section */
.nav-left {
  display: flex;
  align-items: center;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Right Section */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation Groups */
.nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  border-left: 1px solid var(--border-color);
}

.nav-group:first-of-type {
  border-left: none;
  padding-left: 0;
}

.nav-profile-group,
.nav-settings-group {
  margin-left: 0.25rem;
}

/* Icon Buttons (for navigation items) */
.nav-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
}

.nav-icon-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-icon-btn.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-icon-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 8px;
  right: 8px;
  height: 2px;
  background-color: var(--text-primary);
}

.nav-icon-btn > svg {
  width: 20px;
  height: 20px;
}

/* Theme Toggle */
.theme-toggle {
  color: var(--text-primary);
}

/* Navigation Dropdown (Tools Menu) */
.nav-dropdown {
  position: relative;
  padding: 0;
  border-left: none;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition: all 0.2s ease;
  overflow: hidden;
}

.nav-dropdown.active .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu .dropdown-item {
  padding: 0.75rem 1rem;
}

.nav-dropdown-menu .dropdown-item.active {
  background-color: var(--bg-tertiary);
}

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

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

.user-menu-btn:hover {
  background-color: var(--bg-tertiary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.user-avatar > svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.menu-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.user-menu.active .menu-chevron {
  transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: inherit;
}

.dropdown-item:first-child {
  border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 12px 12px;
}

.dropdown-item:hover {
  background-color: var(--bg-tertiary);
}

.dropdown-item > svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.5rem 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }

  .logo {
    display: none;
  }

  .user-name {
    display: none;
  }

  .nav-icon-btn {
    width: 36px;
    height: 36px;
  }

  .nav-icon-btn > svg {
    width: 18px;
    height: 18px;
  }

  .nav-group {
    padding: 0 0.25rem;
  }

  .nav-group:first-of-type {
    padding-left: 0;
  }
}

@media (max-width: 480px) {
  .nav-right {
    gap: 0.25rem;
  }
  
  .user-menu-btn {
    padding: 0.5rem;
  }

  .nav-group {
    padding: 0 0.125rem;
    gap: 0.25rem;
  }

  .nav-icon-btn {
    width: 32px;
    height: 32px;
  }

  .nav-icon-btn > svg {
    width: 16px;
    height: 16px;
  }
}
