/* Navigation CSS - Header nav, dropdown menu */

/* ============================================
   Main Header
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 40;
    background-color: hsl(var(--background));
    border-bottom: 1px solid hsl(var(--border));
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   Logo
   ============================================ */
.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.logo img,
.logo svg {
    height: 1.75rem;
    width: auto;
}

/* ============================================
   Main Navigation
   ============================================ */
.nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 768px) {
    .nav {
        display: flex;
    }
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: hsl(var(--foreground));
    background-color: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast) ease-in-out;
}

.nav-item:hover {
    background-color: hsl(var(--muted));
}

.nav-item.active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.nav-item svg,
.nav-item .icon {
    width: 1rem;
    height: 1rem;
}

/* Nav separator */
.nav-separator {
    width: 1px;
    height: 1.5rem;
    margin: 0 0.5rem;
    background-color: hsl(var(--border));
}

/* ============================================
   Dropdown Menu
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: hsl(var(--foreground));
    background-color: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all var(--transition-fast) ease-in-out;
}

.dropdown-trigger:hover {
    background-color: hsl(var(--muted));
}

.dropdown-trigger.active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.dropdown-trigger svg,
.dropdown-trigger .icon {
    width: 1rem;
    height: 1rem;
}

.dropdown-trigger .chevron {
    transition: transform var(--transition-fast) ease-in-out;
}

.dropdown.is-open .dropdown-trigger .chevron {
    transform: rotate(180deg);
}

/* Dropdown menu content */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    min-width: 12rem;
    margin-top: 0.25rem;
    padding: 0.25rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: all var(--transition-fast) ease-in-out;
}

.dropdown.is-open .dropdown-menu,
.dropdown-menu[data-state="open"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu[hidden] {
    display: none;
}

/* Dropdown menu item */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    color: hsl(var(--foreground));
    background-color: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: background-color var(--transition-fast) ease-in-out;
}

.dropdown-item:hover {
    background-color: hsl(var(--muted));
}

.dropdown-item.active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.dropdown-item svg,
.dropdown-item .icon {
    width: 1rem;
    height: 1rem;
}

/* Dropdown separator */
.dropdown-separator {
    height: 1px;
    margin: 0.25rem 0;
    background-color: hsl(var(--border));
}

/* Dropdown header/label */
.dropdown-label {
    padding: 0.5rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Account Info
   ============================================ */
.header-account {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-account-info {
    text-align: right;
    font-size: var(--text-sm);
}

.header-account-label {
    color: hsl(var(--muted-foreground));
}

.header-account-value {
    margin-left: 0.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

/* ============================================
   Mobile Menu Toggle
   ============================================ */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
}

.mobile-menu-toggle:hover {
    background-color: hsl(var(--muted));
}

.mobile-menu-toggle svg,
.mobile-menu-toggle .icon {
    width: 1.5rem;
    height: 1.5rem;
    color: hsl(var(--foreground));
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background-color: hsl(var(--background));
    padding: var(--spacing-md);
    transform: translateX(-100%);
    transition: transform var(--transition-normal) ease-in-out;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu .nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    font-size: var(--text-base);
}

.mobile-menu .nav-separator {
    width: 100%;
    height: 1px;
    margin: 0.5rem 0;
}

@media (min-width: 768px) {
    .mobile-menu {
        display: none;
    }
}

/* ============================================
   User Dropdown
   ============================================ */
.user-dropdown {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: 500;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    background-color: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--transition-fast) ease-in-out;
}

.user-dropdown-trigger:hover {
    background-color: hsl(var(--muted));
}

.user-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 14rem;
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: var(--text-sm);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: hsl(var(--muted-foreground));
}

.breadcrumb-item a {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color var(--transition-fast) ease-in-out;
}

.breadcrumb-item a:hover {
    color: hsl(var(--foreground));
}

.breadcrumb-item.active {
    color: hsl(var(--foreground));
    font-weight: 500;
}

.breadcrumb-separator {
    color: hsl(var(--muted-foreground));
    margin: 0 0.25rem;
}

.breadcrumb-separator svg,
.breadcrumb-separator .icon {
    width: 1rem;
    height: 1rem;
}
