/* =========================================================
   Care Navigator — Enterprise Mega Menu Navigation
   Version: 1.0
   Premium navigation with mega dropdowns and breadcrumbs
   ========================================================= */

/* ============================================
   HEADER ENHANCEMENTS
   ============================================ */

.site-header-modern {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
  box-shadow: 0 4px 24px rgba(14, 165, 233, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header-modern::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 50%, #3b82f6 100%);
  opacity: 0.6;
}

.site-header-modern::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 50%, #3b82f6 100%);
  opacity: 0.6;
}

/* Brand Styling */
.modern-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem;
  border-radius: 12px;
}

.modern-brand:hover {
  transform: translateY(-2px);
}

.brand-logo-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modern-brand:hover .brand-logo-modern {
  transform: scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 4px 8px rgba(14, 165, 233, 0.3));
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-tertiary, #94a3b8);
  font-weight: 500;
}

/* ============================================
   BREADCRUMB NAVIGATION
   ============================================ */

.breadcrumb-nav {
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
  padding: 1rem 0;
  font-size: 0.875rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-tertiary, #64748b);
}

.breadcrumb-item a {
  color: var(--text-secondary, #475569);
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.breadcrumb-item a:hover {
  color: var(--accent-primary, #0ea5e9);
}

.breadcrumb-item.is-active {
  color: var(--text-primary, #0f172a);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--text-tertiary, #cbd5e1);
  user-select: none;
}

/* ============================================
   MEGA MENU DROPDOWN
   ============================================ */

.nav-item-with-mega {
  position: relative;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.notification-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0);
}

.notification-header {
  padding: 1rem 1.5rem 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-primary, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notification-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem 1.5rem;
}
.notification-empty {
  text-align: center;
  color: var(--text-tertiary, #64748b);
  padding: 2rem 0 1rem 0;
}
.notification-view-all {
  display: block;
  text-align: center;
  padding: 0.75rem 0;
  color: var(--accent-primary, #0ea5e9);
  font-weight: 600;
  text-decoration: none;
  border-top: 1px solid var(--border-primary, #e2e8f0);
  border-radius: 0 0 12px 12px;
  background: var(--bg-secondary, #f8fafc);
  transition: background 0.2s;
}
.notification-view-all:hover {
  background: var(--bg-tertiary, #e0f2fe);
}
.nav-mega-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  background: none;
  border: 2px solid transparent;
  white-space: nowrap;
  position: relative;
}

.nav-mega-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-mega-trigger:hover {
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.2);
  transform: translateY(-1px);
}

.nav-mega-trigger:hover::before {
  opacity: 1;
}

.nav-mega-trigger svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.nav-mega-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 700px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(14, 165, 233, 0.25), 0 0 0 1px rgba(14, 165, 233, 0.1);
  padding: 2.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.mega-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 50%, #3b82f6 100%);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

[data-theme="dark"] .mega-menu {
  background: var(--bg-secondary, #1e293b);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.nav-item-with-mega:hover .mega-menu,
.nav-item-with-mega .nav-mega-trigger[aria-expanded="true"] ~ .mega-menu,
.nav-mega-trigger[aria-expanded="true"] + .mega-menu,
.mega-menu:hover {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: all !important;
  transform: translateX(-50%) translateY(0) !important;
  display: block !important;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.mega-menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mega-menu-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(14, 165, 233, 0.2);
}

.mega-menu-link {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.mega-menu-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mega-menu-link:hover {
  background: rgba(248, 250, 252, 0.8);
  border-color: rgba(14, 165, 233, 0.3);
  transform: translateX(6px) translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.mega-menu-link:hover::before {
  opacity: 1;
}

.mega-menu-link:hover .mega-menu-icon {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

[data-theme="dark"] .mega-menu-link:hover {
  background: var(--bg-tertiary, #334155);
}

.mega-menu-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  border-radius: 12px;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mega-menu-content {
  flex: 1;
}

.mega-menu-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mega-menu-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mega-menu-description {
  font-size: 0.8125rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
  margin: 0;
}

/* Mega menu CTA section */
.mega-menu-cta {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border-primary, #e2e8f0);
}

.mega-menu-cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #0284c7 100%);
  border-radius: 16px;
  color: white;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
  position: relative;
  overflow: hidden;
}

.mega-menu-cta-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
  pointer-events: none;
}

.mega-menu-cta-text h4 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.375rem 0;
}

.mega-menu-cta-text p {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.95;
}

.mega-menu-cta-button {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  background: white;
  color: #0ea5e9;
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.mega-menu-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================
   USER DROPDOWN MENU
   ============================================ */

.user-dropdown {
  position: relative;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-secondary, #f8fafc);
  border: 2px solid var(--border-primary, #e2e8f0);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-dropdown-trigger:hover {
  border-color: var(--accent-primary, #0ea5e9);
  background: white;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  max-width: 150px;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-tertiary, #64748b);
}

.user-dropdown-icon {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary, #94a3b8);
  transition: transform 0.3s ease;
}

.user-dropdown-trigger[aria-expanded="true"] .user-dropdown-icon {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

[data-theme="dark"] .user-dropdown-menu {
  background: var(--bg-secondary, #1e293b);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.user-dropdown-trigger[aria-expanded="true"] + .user-dropdown-menu,
.user-dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-primary, #e2e8f0);
  margin-bottom: 0.5rem;
}

.user-dropdown-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin: 0 0 0.25rem 0;
}

.user-dropdown-email {
  font-size: 0.8125rem;
  color: var(--text-tertiary, #64748b);
  margin: 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary, #475569);
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.user-dropdown-item:hover {
  background: var(--bg-secondary, #f8fafc);
  color: var(--accent-primary, #0ea5e9);
}

[data-theme="dark"] .user-dropdown-item:hover {
  background: var(--bg-tertiary, #334155);
}

.user-dropdown-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-primary, #e2e8f0);
  margin: 0.5rem 0;
}

.user-dropdown-item.is-danger {
  color: #ef4444;
}

.user-dropdown-item.is-danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

[data-theme="dark"] .user-dropdown-item.is-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   NOTIFICATION BELL
   ============================================ */

.notification-bell {
  position: relative;
  padding: 0.5rem;
  background: none;
  border: 2px solid var(--border-primary, #e2e8f0);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell:hover {
  border-color: var(--accent-primary, #0ea5e9);
  background: var(--bg-secondary, #f8fafc);
}

.notification-bell svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary, #475569);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 0.25rem;
  background: #ef4444;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  animation: notification-pulse 2s ease-in-out infinite;
}

@keyframes notification-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ============================================
   ENHANCED HEADER UTILITIES
   ============================================ */

.header-utilities-enhanced {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Quick action buttons */
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  color: white !important;
  font-weight: 600;
  font-size: 0.875rem;
  border: 2px solid rgba(14, 165, 233, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
  position: relative;
  overflow: hidden;
}

.quick-action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
  border-color: rgba(14, 165, 233, 0.5);
}

.quick-action-btn:hover::before {
  opacity: 1;
}

.quick-action-btn span {
  color: white !important;
  position: relative;
  z-index: 1;
}

.quick-action-btn svg {
  width: 18px;
  height: 18px;
  color: white !important;
  stroke: white !important;
  position: relative;
  z-index: 1;
  animation: chatIconPulse 3s ease-in-out infinite;
}

.chat-icon-gradient {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

@keyframes chatIconPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
  }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
  .mega-menu {
    left: 0;
    right: 0;
    transform: translateX(0) translateY(10px);
    min-width: auto;
    max-width: 90vw;
    margin: 0 auto;
  }
  
  .nav-item-with-mega:hover .mega-menu {
    transform: translateX(0) translateY(0);
  }
  
  .mega-menu-grid {
    grid-template-columns: 1fr;
  }
  
  .mega-menu-cta-content {
    flex-direction: column;
    text-align: center;
  }
  
  .user-info {
    display: none;
  }
  
  .breadcrumb-nav {
    padding: 0.75rem 0;
  }
  
  .breadcrumb-list {
    font-size: 0.8125rem;
  }
}

@media (max-width: 640px) {
  .header-utilities-enhanced {
    gap: 0.5rem;
  }
  
  .quick-action-btn span {
    display: none;
  }
  
  .quick-action-btn {
    padding: 0.625rem;
  }
}
