// Enhanced header and navigation styles for Chainguard Academy
// Aligned with marketing site aesthetics

// Main header container
.header-background {
    background: var(--header-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(20, 0, 61, 0.08);
    transition: all 0.3s ease;
    
    // Add subtle shadow on scroll
    &.scrolled {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    }
}

// Navigation bar enhancements
.navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    
    .navbar-brand {
        font-weight: 600;
        transition: opacity 0.2s ease;
        
        &:hover {
            opacity: 0.8;
        }
        
        img {
            height: 32px;
            width: auto;
        }
    }
    
    .navbar-nav {
        .nav-link {
            color: var(--body-color);
            font-weight: 500;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            transition: all 0.2s ease;
            position: relative;
            
            &:hover {
                background-color: rgba(117, 69, 251, 0.08);
                color: var(--primary-1);
            }
            
            &.active {
                color: var(--primary-1);
                background-color: rgba(117, 69, 251, 0.1);
            }
        }
    }
}

// Search bar enhancements
.search-container {
    .form-control {
        background: var(--search-background);
        border: 1px solid transparent;
        border-radius: 8px;
        padding: 0.5rem 1rem;
        transition: all 0.2s ease;
        
        &:focus {
            border-color: var(--primary-1);
            box-shadow: 0 0 0 3px rgba(117, 69, 251, 0.1);
            background: var(--body-background);
        }
        
        &::placeholder {
            color: var(--placeholder-color);
            opacity: 0.7;
        }
    }
    
    .search-icon {
        color: var(--primary-1);
    }
}

// Mobile menu enhancements
.offcanvas {
    .offcanvas-header {
        border-bottom: 1px solid rgba(20, 0, 61, 0.08);
        padding: 1rem 1.5rem;
        
        .btn-close {
            opacity: 0.5;
            transition: opacity 0.2s ease;
            
            &:hover {
                opacity: 1;
            }
        }
    }
    
    .offcanvas-body {
        padding: 1.5rem;
        
        .nav-link {
            padding: 0.75rem 1rem;
            margin-bottom: 0.25rem;
            border-radius: 8px;
            transition: all 0.2s ease;
            
            &:hover {
                background-color: rgba(117, 69, 251, 0.08);
                transform: translateX(4px);
            }
            
            &.active {
                background-color: rgba(117, 69, 251, 0.1);
                color: var(--primary-1);
                font-weight: 600;
            }
        }
    }
}

// Language selector enhancement
.language-selector {
    select {
        background: var(--search-background);
        border: 1px solid rgba(20, 0, 61, 0.08);
        border-radius: 6px;
        padding: 0.4rem 2rem 0.4rem 0.8rem;
        font-size: 0.9rem;
        transition: all 0.2s ease;
        cursor: pointer;
        
        &:hover {
            border-color: var(--primary-1);
        }
        
        &:focus {
            border-color: var(--primary-1);
            box-shadow: 0 0 0 3px rgba(117, 69, 251, 0.1);
            outline: none;
        }
    }
}

// Dark mode toggle enhancement
.dark-mode-toggle {
    background: transparent;
    border: 2px solid var(--primary-1);
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    
    &:hover {
        background: var(--primary-1);
        
        .toggle-icon {
            color: white;
        }
    }
    
    .toggle-icon {
        font-size: 1rem;
        transition: color 0.2s ease;
    }
}

// Breadcrumb enhancement
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    
    .breadcrumb-item {
        font-size: 0.875rem;
        
        + .breadcrumb-item::before {
            color: var(--body-color);
            opacity: 0.5;
        }
        
        a {
            color: var(--body-color);
            text-decoration: none;
            transition: color 0.2s ease;
            
            &:hover {
                color: var(--primary-1);
            }
        }
        
        &.active {
            color: var(--primary-1);
            font-weight: 500;
        }
    }
}

// Sticky header behavior
@media (min-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: var(--header-background);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

// Dark mode adjustments
:root[data-dark-mode] {
    .header-background {
        border-bottom-color: rgba(255, 255, 255, 0.1);
        
        &.scrolled {
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
        }
    }
    
    .navbar {
        .navbar-nav {
            .nav-link {
                &:hover {
                    background-color: rgba(122, 240, 254, 0.08);
                    color: var(--primary-2);
                }
                
                &.active {
                    color: var(--primary-2);
                    background-color: rgba(122, 240, 254, 0.1);
                }
            }
        }
    }
    
    .search-container {
        .form-control {
            &:focus {
                border-color: var(--primary-2);
                box-shadow: 0 0 0 3px rgba(122, 240, 254, 0.1);
            }
        }
    }
    
    .language-selector {
        select {
            border-color: rgba(255, 255, 255, 0.1);
            
            &:hover {
                border-color: var(--primary-2);
            }
            
            &:focus {
                border-color: var(--primary-2);
                box-shadow: 0 0 0 3px rgba(122, 240, 254, 0.1);
            }
        }
    }
    
    .dark-mode-toggle {
        border-color: var(--primary-2);
        
        &:hover {
            background: var(--primary-2);
        }
    }
}