.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid transparent;
    box-shadow: none;
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(232, 236, 241, 0.6);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.06);
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-500);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-right: 32px;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.85;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s ease;
    filter: drop-shadow(0 0 0 transparent);
}

.logo:hover .logo-img {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 8px rgba(36, 104, 242, 0.25));
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
}

.nav-links.scrolled-end {
    mask-image: none;
    -webkit-mask-image: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease, background 0.3s ease, font-weight 0.2s ease;
    border-radius: var(--radius-md);
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--primary-500);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--primary-500);
    background: var(--bg-secondary);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--primary-500);
    border-radius: 0;
    animation: navIndicatorIn 0.3s ease forwards;
}

@keyframes navIndicatorIn {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    margin-left: 24px;
}

.nav-action-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-action-link:hover {
    color: var(--primary-500);
}

.nav-auth-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-auth-user {
    cursor: default;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-auth-logout {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.search-container {
    position: relative;
}

.search-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.search-btn:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
}

.search-input-container {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.search-input-container.active {
    width: 280px;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
}

.search-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(36, 104, 242, 0.1);
}

.nav-actions .btn {
    height: 66px;
    padding: 0 28px;
    border-radius: 0;
    border: none;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
}

@media (max-width: 1024px) {
    .navbar {
        padding: 0 20px;
    }

    .logo-img {
        height: 36px;
    }

    .logo {
        margin-right: 20px;
        gap: 8px;
        font-size: 20px;
    }

    .nav-links {
        display: none;
    }

    .search-container {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        z-index: 999;
        animation: mobileMenuIn 0.25s ease;
    }

    .nav-links.mobile-open .nav-link {
        padding: 12px 16px;
        border-radius: var(--radius-md);
    }

    .nav-links.mobile-open .nav-link.active {
        background: rgba(36, 104, 242, 0.08);
        color: var(--primary-500);
        font-weight: 600;
    }

    .nav-links.mobile-open .nav-link.active::after {
        display: none;
    }

    .nav-actions.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: auto;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        z-index: 999;
        gap: 12px;
    }

    .nav-actions .btn {
        height: auto;
        padding: 10px 20px;
        border-radius: var(--radius-md);
    }

    .nav-auth-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .nav-auth-actions .nav-action-link,
    .nav-auth-actions .nav-auth-logout {
        padding: 10px 0;
    }
}

@keyframes mobileMenuIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}