/**
 * NavigationMenu styles
 * @countermeasure/web-components/navigation/navigation-menu
 */

/* ============================================================================
   NAV MENU CONTAINER
   ============================================================================ */
.cmm-nav-menu {
  display: flex;
  align-items: center;
  position: relative;
}

/* ============================================================================
   MENU LIST
   ============================================================================ */
.cmm-nav-menu__list {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.cmm-nav-menu__list--collapsed {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  padding: 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background-color: hsl(var(--background));
  box-shadow: var(--shadow-lg);
  z-index: var(--z-popover, 500);
}

.cmm-nav-menu__list--mobile-open {
  animation: cmm-nav-menu-mobile-in var(--transition-fast, 150ms) ease-out;
}

@keyframes cmm-nav-menu-mobile-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   TRIGGER / LINK ITEMS
   ============================================================================ */
.cmm-nav-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.cmm-nav-menu__trigger:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.cmm-nav-menu__trigger:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: -1px;
}

.cmm-nav-menu__trigger--active {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.cmm-nav-menu__trigger--current {
  color: hsl(var(--foreground));
}

.cmm-nav-menu__trigger--current::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: hsl(var(--primary));
  border-radius: 1px;
}

/* ============================================================================
   CHEVRON & ICON
   ============================================================================ */
.cmm-nav-menu__chevron {
  font-size: 0.625rem;
  color: hsl(var(--muted-foreground));
  transition: transform var(--transition-fast);
}

.cmm-nav-menu__trigger--active .cmm-nav-menu__chevron {
  transform: rotate(180deg);
}

.cmm-nav-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.cmm-nav-menu__icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================================================
   HAMBURGER BUTTON
   ============================================================================ */
.cmm-nav-menu__hamburger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 2rem;
  height: 2rem;
  padding: 0.375rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.cmm-nav-menu__hamburger:hover {
  background-color: hsl(var(--accent));
}

.cmm-nav-menu__hamburger:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: -1px;
}

.cmm-nav-menu__hamburger span {
  display: block;
  width: 1rem;
  height: 2px;
  background-color: hsl(var(--foreground));
  border-radius: 1px;
}

/* ============================================================================
   MEGA-MENU DROPDOWN
   ============================================================================ */
.cmm-nav-menu__dropdown {
  position: fixed;
  z-index: var(--z-popover, 500);
  min-width: 280px;
  max-width: 560px;
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background-color: hsl(var(--background));
  box-shadow: var(--shadow-lg);
  animation: cmm-nav-menu-dropdown-in var(--transition-fast, 150ms) ease-out;
}

@keyframes cmm-nav-menu-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cmm-nav-menu__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

/* ============================================================================
   NAVIGATION CARDS
   ============================================================================ */
.cmm-nav-menu__card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: hsl(var(--foreground));
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.cmm-nav-menu__card:hover {
  background-color: hsl(var(--accent));
}

.cmm-nav-menu__card:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: -1px;
}

.cmm-nav-menu__card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
  color: hsl(var(--muted-foreground));
}

.cmm-nav-menu__card-icon svg {
  width: 100%;
  height: 100%;
}

.cmm-nav-menu__card-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.cmm-nav-menu__card-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.cmm-nav-menu__card-desc {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
