/**
 * Navbar Component Styles
 * Provides styling for navigation bars with responsive design
 */

.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Brand section */
.navbar-brand {
    display: flex;
    align-items: center;
    margin-right: auto;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1890ff;
    text-decoration: none;
}

.navbar-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.navbar-brand-link:hover {
    color: #40a9ff;
}

.navbar-logo {
    height: 32px;
    width: auto;
    margin-right: 0.5rem;
}

.navbar-brand-text {
    color: inherit;
}

/* Toggle button for mobile */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.navbar-toggle:hover {
    background-color: #f8f9fa;
}

.navbar-toggle:focus {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

.navbar-toggle-icon {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
    justify-content: space-between;
}

.navbar-toggle-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #333;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.navbar-collapsed .navbar-toggle-icon span:first-child {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-collapsed .navbar-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.navbar-collapsed .navbar-toggle-icon span:last-child {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation collapse */
.navbar-collapse {
    display: flex;
    align-items: center;
    flex-grow: 1;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.navbar-nav {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navbar-nav-item {
    position: relative;
    margin: 0 0.5rem;
}

.navbar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navbar-nav-link:hover {
    color: #1890ff;
    background-color: #f0f8ff;
}

.navbar-nav-link:focus {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

.navbar-nav-active {
    color: #1890ff !important;
    background-color: #e6f7ff !important;
    font-weight: 500;
}

.navbar-nav-disabled {
    color: #ccc !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.navbar-nav-disabled:hover {
    background-color: transparent !important;
}

.navbar-nav-icon {
    margin-right: 0.5rem;
    font-size: 16px;
}

/* Dropdown functionality */
.navbar-dropdown {
    position: relative;
}

.navbar-dropdown-toggle {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #333;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navbar-dropdown-toggle:hover {
    color: #1890ff;
    background-color: #f0f8ff;
}

.navbar-dropdown-toggle:focus {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

.navbar-dropdown-caret {
    margin-left: 0.5rem;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.3s ease;
}

.navbar-dropdown-open .navbar-dropdown-caret {
    transform: rotate(180deg);
}

.navbar-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.navbar-dropdown-open .navbar-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-dropdown-item {
    margin: 0;
}

.navbar-dropdown-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-dropdown-link:hover {
    color: #1890ff;
    background-color: #f0f8ff;
}

.navbar-dropdown-icon {
    margin-right: 0.5rem;
    font-size: 14px;
}

.navbar-dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 0.5rem 0;
}

/* Actions section */
.navbar-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.navbar-action {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.navbar-action-icon {
    margin-right: 0.5rem;
    font-size: 16px;
}

.navbar-action.default {
    color: #333;
    background-color: transparent;
    border-color: #d9d9d9;
}

.navbar-action.default:hover {
    color: #1890ff;
    border-color: #1890ff;
}

.navbar-action.primary {
    color: #fff;
    background-color: #1890ff;
    border-color: #1890ff;
}

.navbar-action.primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

.navbar-action.secondary {
    color: #333;
    background-color: #f5f5f5;
    border-color: #d9d9d9;
}

.navbar-action.secondary:hover {
    background-color: #e6e6e6;
    border-color: #bfbfbf;
}

/* Variants */
.navbar-light {
    background-color: #fff;
    border-color: #e9ecef;
}

.navbar-dark {
    background-color: #343a40;
    border-color: #495057;
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav-link,
.navbar-dark .navbar-dropdown-toggle {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav-link:hover,
.navbar-dark .navbar-dropdown-toggle:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-dark .navbar-nav-active {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.navbar-dark .navbar-toggle-icon span {
    background-color: rgba(255, 255, 255, 0.85);
}

.navbar-primary {
    background-color: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.navbar-primary .navbar-brand,
.navbar-primary .navbar-nav-link,
.navbar-primary .navbar-dropdown-toggle {
    color: #fff;
}

.navbar-primary .navbar-nav-link:hover,
.navbar-primary .navbar-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-primary .navbar-nav-active {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.navbar-primary .navbar-toggle-icon span {
    background-color: #fff;
}

/* Positioning */
.navbar-fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

.navbar-fixed-bottom {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

.navbar-sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Transparent navbar */
.navbar-transparent {
    background-color: transparent;
    border-color: transparent;
}

.navbar-transparent.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(233, 236, 239, 0.5);
    backdrop-filter: blur(10px);
}

/* Shadow */
.navbar-shadow {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 767px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-collapse {
        flex-basis: 100%;
        flex-grow: 1;
        align-items: flex-start;
        max-height: 0;
        overflow: hidden;
    }

    .navbar-collapsed .navbar-collapse {
        max-height: 100vh;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 1rem 0;
    }

    .navbar-nav-item {
        margin: 0;
        width: 100%;
    }

    .navbar-nav-link {
        padding: 0.75rem 1rem;
        width: 100%;
        justify-content: flex-start;
    }

    .navbar-dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e9ecef;
        border-radius: 0;
        margin: 0;
        padding: 0;
        background-color: #f8f9fa;
    }

    .navbar-dropdown-open .navbar-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .navbar-dropdown-link {
        padding: 0.75rem 2rem;
    }

    .navbar-actions {
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e9ecef;
        width: 100%;
        justify-content: center;
    }

    .navbar-action {
        margin: 0 0.25rem;
    }
}

/* Accessibility improvements */
.navbar-nav-link:focus-visible,
.navbar-dropdown-toggle:focus-visible,
.navbar-action:focus-visible {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .navbar {
        border-bottom: 2px solid;
    }
    
    .navbar-nav-link,
    .navbar-dropdown-toggle,
    .navbar-action {
        border: 1px solid;
    }
    
    .navbar-dropdown-menu {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .navbar,
    .navbar-nav-link,
    .navbar-dropdown-toggle,
    .navbar-action,
    .navbar-dropdown-menu,
    .navbar-toggle-icon span,
    .navbar-dropdown-caret {
        transition: none;
    }
}

/* Print styles */
@media print {
    .navbar {
        display: none;
    }
}