/* ==========================================
   NAVIGATION BAR STYLES
   ========================================== */

:root {
    --nav-height: 60px;
    --nav-bg: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    --nav-text: #ffffff;
    --nav-hover-bg: rgba(255, 255, 255, 0.15);
    --dropdown-bg: #ffffff;
    --dropdown-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --mobile-breakpoint: 992px;
}

/* Main Navigation Container */
.main-nav {
    background: var(--nav-bg);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Brand/Logo */
.nav-brand {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.025em;
}

.brand-link:hover {
    opacity: 0.9;
}

.brand-link i {
    font-size: 1.5rem;
}

.brand-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Mobile Toggle Button */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger {
    width: 24px;
    height: 2px;
    background: var(--nav-text);
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex: 1;
    justify-content: flex-end;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Navigation Items */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
    background: var(--nav-hover-bg);
    color: var(--nav-text);
}

.nav-link i:first-child {
    font-size: 1rem;
}

/* Active State */
.nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Dropdown Styles */
.dropdown-toggle {
    cursor: pointer;
}

.dropdown-icon {
    font-size: 0.65rem;
    margin-left: 0.25rem;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 240px;
    background: var(--dropdown-bg);
    border-radius: 0.5rem;
    box-shadow: var(--dropdown-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 1000;
    border: 1px solid #E2E8F0;
}

.dropdown.active .dropdown-menu,
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: #1E293B;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.dropdown-link:hover {
    background: #F1F5F9;
    color: #0F766E;
}

.dropdown-link i {
    width: 18px;
    text-align: center;
    color: #0F766E;
    font-size: 14px;
}

.dropdown-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 0.5rem 0;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Search Button */
.nav-search .nav-link {
    padding: 0.625rem;
    width: 36px;
    height: 36px;
    justify-content: center;
}

.search-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================
   SEARCH OVERLAY
   ========================================== */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    background: #FFFFFF;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active .search-overlay-content {
    transform: scale(1);
}

.search-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: #64748B;
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-close:hover {
    background: #F1F5F9;
    color: #1E293B;
}

.search-container h2 {
    margin: 0 0 1.5rem 0;
    color: #1E293B;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.global-search-form {
    margin-bottom: 1.5rem;
}

.search-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-group .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1rem;
}

.search-input-group input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 14px;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    background: #F8FAFC;
    color: #1E293B;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.search-input-group input:focus {
    outline: none;
    border-color: #0F766E;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
    background: #FFFFFF;
}

.search-input-group input::placeholder {
    color: #94A3B8;
}

.search-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 1px solid #E2E8F0;
    border-radius: 0.375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
}

.search-filter-label:hover {
    border-color: #0F766E;
    background: rgba(15, 118, 110, 0.05);
}

.search-filter-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.search-filter-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #0F766E;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #F8FAFC;
}

.search-results::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #64748B;
}

.search-result-item {
    padding: 0.875rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    background: #F8FAFC;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.search-result-item:hover {
    background: #F1F5F9;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.search-result-title {
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 0.25rem;
    font-size: 14px;
}

.search-result-code {
    font-size: 12px;
    color: #64748B;
    font-family: 'Monaco', 'Menlo', monospace;
}

.search-result-type {
    font-size: 11px;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.search-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748B;
}

.search-no-results i {
    font-size: 3rem;
    color: #CBD5E1;
    margin-bottom: 1rem;
    display: block;
}

.search-no-results p {
    font-size: 14px;
    margin: 0;
}

.search-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748B;
    font-size: 14px;
}

.search-loading i {
    margin-right: 0.5rem;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 992px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: linear-gradient(180deg, #0F766E 0%, #0D5E57 100%);
        opacity: 0;
        visibility: hidden;
        transform: translateX(-100%);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding: 1.5rem;
    }

    .nav-toggle[aria-expanded="true"] + .nav-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.875rem 1rem;
        border-radius: 0.375rem;
        margin-bottom: 0.25rem;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 0.5rem;
        border: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
    }

    .dropdown.active .dropdown-menu {
        max-height: 500px;
    }

    .dropdown-link {
        color: var(--nav-text);
        padding: 0.75rem 1.5rem;
    }

    .dropdown-link:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--nav-text);
    }

    .dropdown-link i {
        color: var(--nav-text);
    }

    .dropdown-divider {
        background: rgba(255, 255, 255, 0.2);
    }

    .dropdown-header {
        color: rgba(255, 255, 255, 0.6);
        padding: 0.5rem 1.5rem;
    }

    .search-overlay-content {
        width: 95%;
        padding: 1.5rem;
    }

    .search-container h2 {
        font-size: 1.25rem;
    }

    .search-filters {
        gap: 0.5rem;
    }

    .search-filter-label {
        font-size: 12px;
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .nav-container {
        padding: 0 1rem;
    }

    .brand-link {
        font-size: 1.125rem;
    }

    .brand-link i {
        font-size: 1.25rem;
    }

    .search-overlay-content {
        padding: 1.25rem;
    }

    .search-container h2 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .search-input-group input {
        padding: 0.75rem 0.875rem 0.75rem 2.75rem;
        font-size: 13px;
    }

    .search-filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-filter-label {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dropdown-menu {
    animation: slideDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

.nav-link:focus,
.dropdown-link:focus,
.search-toggle:focus,
.nav-toggle:focus,
.search-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.dropdown-link:focus {
    outline-color: #0F766E;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link:hover,
    .dropdown-link:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .dropdown-menu {
        border: 2px solid #1E293B;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}