/**
 * Waita Market Add-on - Navigation Header Styles
 */

/* Header Container */
.wma-header {
    background: var(--wma-bg);
    border-bottom: 1px solid var(--wma-border-light);
    box-shadow: var(--wma-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.wma-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 64px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Brand Section */
.wma-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wma-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.wma-site-logo {
    max-width: 100%;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.wma-site-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.wma-logo-fallback {
    width: 40px;
    height: 40px;
    background: var(--wma-primary);
    color: var(--wma-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.wma-brand-text {
    display: flex;
    flex-direction: column;
}

.wma-brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--wma-text);
    line-height: 1.2;
}

.wma-user-role {
    font-size: 12px;
    color: var(--wma-text-light);
    font-weight: 500;
}

/* Navigation */
.wma-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.wma-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.wma-nav-item {
    margin: 0;
}

.wma-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--wma-text-light);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
}

.wma-nav-link:hover {
    background: var(--wma-bg-secondary);
    color: var(--wma-text);
    text-decoration: none;
}

.wma-nav-link.active {
    background: var(--wma-primary-light);
    color: var(--wma-primary);
}

.wma-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.wma-nav-icon svg {
    width: 20px;
    height: 20px;
}

.wma-nav-text {
    white-space: nowrap;
}

/* User Menu */
.wma-header-actions {
    display: flex;
    align-items: center;
}

.wma-user-menu {
    position: relative;
}

.wma-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--wma-bg-secondary);
    border: 1px solid var(--wma-border-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--wma-text);
    transition: all 0.2s;
}

.wma-user-toggle:hover {
    background: var(--wma-bg-tertiary);
    border-color: var(--wma-border);
}

.wma-user-avatar {
    width: 28px;
    height: 28px;
    background: var(--wma-primary);
    color: var(--wma-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    overflow: hidden;
} /* smaller avatar for compact header */

/* Avatar image inside the avatar wrapper */
.wma-user-avatar img,
.wma-user-avatar .wma-user-avatar-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.wma-user-name {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile adjustments: larger logo and avatar for small screens */
@media (max-width: 480px) {
    .wma-logo {
        width: 48px;
        height: 48px;
    }
    
    .wma-site-logo {
        max-height: 48px;
    }
    
    .wma-site-icon {
        width: 40px;
        height: 40px;
    }
    
    .wma-logo-fallback {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 10px;
    }
    
    .wma-user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .wma-user-avatar img,
    .wma-user-avatar .wma-user-avatar-image {
        width: 40px;
        height: 40px;
    }
}

.wma-dropdown-arrow {
    font-size: 10px;
    color: var(--wma-text-lighter);
    transition: transform 0.2s;
}

.wma-user-menu.open .wma-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.wma-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--wma-bg);
    border: 1px solid var(--wma-border-light);
    border-radius: 8px;
    box-shadow: var(--wma-shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 1001;
}

.wma-user-menu.open .wma-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wma-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--wma-text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

/* Hover style for pointer devices */
.wma-dropdown-item:hover {
    background: var(--wma-bg-secondary);
    text-decoration: none;
    color: var(--wma-text);
}

/* Remove hover visual on touch devices to avoid flicker/hover effects on tap */
@media (hover: none) and (pointer: coarse) {
    .wma-dropdown-item:hover,
    .wma-nav-link:hover {
        background: transparent;
        color: inherit;
    }
}

.wma-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.wma-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.wma-dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.wma-dropdown-icon svg {
    width: 16px;
    height: 16px;
}

.wma-dropdown-divider {
    height: 1px;
    background: var(--wma-border-light);
    margin: 4px 0;
}

/* Notification Badge */
.wma-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--wma-danger);
    color: var(--wma-bg);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wma-header-container {
        padding: 0 15px;
        height: 56px;
    }
    
    .wma-brand-name {
        font-size: 16px;
    }
    
    .wma-nav-text {
        display: none;
    }
    
    .wma-nav-link {
        padding: 8px 12px;
    }
    
    .wma-nav-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .wma-user-name {
        display: none;
    }
    
    .wma-user-toggle {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .wma-header-container {
        padding: 0 10px;
        height: 72px;
    }
    
    .wma-nav-list {
        gap: 4px;
    }
    
    .wma-nav-link {
        padding: 6px 8px;
    }
    
    .wma-brand-text {
        display: none;
    }

    /* Make logo much larger when brand text is hidden */
    .wma-logo {
        width: 80px;
        height: 80px;
    }
    
    .wma-site-logo {
        max-height: 64px;
    }
    
    .wma-site-icon {
        width: 56px;
        height: 56px;
    }
    
    .wma-logo-fallback {
        width: 64px;
        height: 64px;
        font-size: 26px;
        border-radius: 12px;
    }
    
    .wma-user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .wma-user-avatar img,
    .wma-user-avatar .wma-user-avatar-image {
        width: 32px;
        height: 32px;
    }
    
    .wma-user-dropdown {
        right: -10px;
        min-width: 180px;
    }
}

/* Content Adjustment */
.wma-content-container {
    padding-top: 20px;
}

/* Animation for smooth transitions */
.wma-nav-link,
.wma-user-toggle,
.wma-dropdown-item {
    transition: all 0.2s ease-in-out;
}

/* Focus states for accessibility */
.wma-nav-link:focus,
.wma-user-toggle:focus,
.wma-dropdown-item:focus {
    outline: 2px solid var(--wma-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wma-header {
        border-bottom-width: 2px;
    }
    
    .wma-nav-link.active {
        background: var(--wma-primary);
        color: var(--wma-bg);
    }
}